Hi,
YOu could try.
?split()
split(ats,ats$Project_NBR)
You also mentioned about two columns.
split(ats,list(ats$col1, ats$col2))
You should have provided an example dataset using ?dput() ( dput(head(data,10))
) for testing.
Also,
gsub("^-[^-]*-","","-005-190")
#[1] "190"
A.K.
Problem: I have a large data set and need to separate based on factors
in 2 columns. The final output would be a collection of dataframes
renamed to
the corresponding factor levels.
So far I know that for each corresponding factor I can execute
x190<-ats[which(Project_NBR=='-005-190'),]
However there are about 400 factors needing to be separated.
Also, I would like to remove the "-005-". Any guidance will be greatly
appreciated.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.