Re: [R] Splitting dataframes and cleaning extraneous characters

2013-07-17 Thread arun
HI, One problem with using ?subst() would be it depends upon the number of digits, characters etc.  For eg. substring("-005-190",6) #[1] "190"  substring("-0057-190",6) #[1] "-190" #whereas gsub("^-[^-]*-","","-0057-190") #[1] "190" Probably, your dataset doesn't have that sort of problem. d

Re: [R] Splitting dataframes and cleaning extraneous characters

2013-07-17 Thread arun
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 hav