Skip to content

Instantly share code, notes, and snippets.

@moorepants
Created December 7, 2010 04:09
Show Gist options
  • Save moorepants/731442 to your computer and use it in GitHub Desktop.
Save moorepants/731442 to your computer and use it in GitHub Desktop.
shows how to loop through a subset of columns
Redox=read.csv('Redox.csv', header=TRUE)
col = c("pH", "mmol.DOC", "SUVA", "mmol.fe2")
newRedox = Redox[col] # removes columns not in col
for(item in newRedox) # for each column in newRedox
{
ylim = range(item, na.rm=TRUE)
xlim = range(Redox$day, na.rm=TRUE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment