I have used lapply to apply a function to a number of data frames:
data.cleaned <- lapply(data.list, shooter_cleaning)
And then labeled each of the resulting data frames in the list according to their subject number (e.g., 100):
names(data.cleaned) <- subject.names
What I want to do is to save each new data frame as an individual .csv file based on its subject number. For example, for subject 100 I'd like the .csv file to be labeled as "100.csv" Normally to do this (for a single data frame) I would just write (where x is the data frame):
write.csv(x, "100.csv", row.names = F)
But, obviously using lapply to do this for my list of data frames will just produce many copies of "100.csv" when instead I would like the files to be unique, based on their subject number. How can I (use apply to?) save each of these data frames to their own unique .csv file?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…