[R] Looping Over Data Frames
dwinsemius at comcast.net
Tue Apr 30 03:45:20 CEST 2013
On Apr 29, 2013, at 6:03 PM, Sparks, John James wrote:
> Dear R Helpers,
> I am re-phrasing a question that I put forth earlier today due to some
> particulars in the solution that I am searching for. Many thanks to those
> who answered the previous post and to any who would be willing to answer
> this one.
> I have a set of data frames. I need to perform some data scrubbing on
> each of them. I am trying to figure out how to perform the same steps on
> each data frame using some sort of loop or something along those lines.
> Because my actual data frames are quite large and the steps I am taking
> moderately complicated, I would very much prefer not to put them all
> together in a list because when I get an error, I can't determine which
> part of the list is the source of the error. So, I would really
> appreciate it if someone could post a way to perform the following sub
> setting function on the three simple data frames in the example below with
> some sort of loop or something along those lines, which would work
> directly on the data frames in question.
> Many thanks in advance. Please let me know if there is anything I can do
> to make the question more clear.
> --John Sparks
> #Want to build some sort of loop for this.
> for(i in letters[24:26] ) assign( i, subset(get(i), select=-c(V1)) )
1 2 3
2 2 3
3 2 2
4 2 2
5 1 1
Alameda, CA, USA
More information about the R-help