II just want to create a new object with the first two numerals of the data.
Not sure why this isnt working, consider the following:

EmpEst$naics=c(238321, 624410, 484121 ,238911, 811111, 531110, 621399,
541613,
524210 ,236115 ,811121 ,236115 ,236115 ,621610 ,814110 ,812320)


EmpEst$naics2<-formatC(EmpEst$naics %% 1e2, width=2, flag="", mode
="integer")
#RESULT:Warning message:
#In Ops.factor(EmpEst$naics, 100) : %% not meaningful for factors



EmpEst$naics2<-format(EmpEst$naics,trim=FALSE,digits=2,width=2)

#RESULT
#Changes data to string

I know this is super simple but im not sure why i get the error in the first
try.  Help with some excplanation would be helpful, thanks

Cheers
-- 
View this message in context: 
http://www.nabble.com/Selecting-initial-numerals-tp25876664p25876664.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org 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.

Reply via email to