[R] Cleaning up messy Excel data

Rolf Turner rolf.turner at xtra.co.nz
Wed Feb 29 22:41:37 CET 2012


On 01/03/12 04:43, John Kane wrote:
> (mydata<- as.factor(c("1","2","3", ">2", "5", ">2")))
> str(mydata)
>
> newdata<- as.character(mydata)
>
> newdata[newdata==">2"]<- 0
> newdata<- as.numeric(newdata)
> str(newdata)
>
> We really need to keep Excel (and other spreadsheets) out of peoples hands.

Amen, bro'!!!

     cheers,

         Rolf Turner



More information about the R-help mailing list