Then, I can loop through the instruments by doing:ĭ <- get(varNames) # copy the object to an object named `d`Įval(parse(text=paste('rm(', varNames, ')'))) # remove the original object from memoryĭ] <- despike(d]) Where the numbers in the name signify the nominal depth and the names themselves are the object names saved during a previous processing step. To start, I often define a vector of variable names, like: To do this, I make use of the get(), assign(), and eval() functions in R. a dozen or so SBE microCATs all strung out along a mooring line). Often I want to load, manipulate, and re-save a bunch of separate objects (e.g.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |