I am having trouble with formatting data in r.
I do
setwd("S:\\CIU\\Testfolder")
mydata<-read.csv(file="datacsv.csv")
str(mydata)
which shows the field rehab.rate is a character that looks like "48.67%"
I tried
mydata1<-mydata
mydata1$rehab.rate=as.numeric((gsub("%","",mydata1$rehab.rate)))
but end up with NA in the field. I am guessing the decimal place is the issue.
I do
setwd("S:\\CIU\\Testfolder")
mydata<-read.csv(file="datacsv.csv")
str(mydata)
which shows the field rehab.rate is a character that looks like "48.67%"
I tried
mydata1<-mydata
mydata1$rehab.rate=as.numeric((gsub("%","",mydata1$rehab.rate)))
but end up with NA in the field. I am guessing the decimal place is the issue.