Hello people,
I have a problem here again. Look at the following:
Variables: 7
V1 <dttm> 2016-04-29 00:00:00, 2016-04-29 01:00:00, 2016-04-29 02:00:00, 201...
V2 "44448570", "44448570", "44448570", "44448570", "44448570", "444485...
V3 <dttm> 2016-04-28 22:48:00, 2016-04-28 23:48:00, 2016-04-29 00:48:00, 201...
V4 "57'186", "57'186", "57'186", "57'186", "57'186", "57'188", "57'192...
V37 <chr> "Cold Water", "Cold Water", "Cold Water", "Cold Water", "Cold Water...
V38 "47'00", "47'00", "47'00", "47'00", "47'00", "47'00", "47'00", "47'...
$ V39 "SV", "SV", "SV", "SV", "SV", "SV", "SV", "SV", "SV", "SV", "SV", "...
DHW2 <- data.frame(apply(mydata,2,as.numeric))
Error in apply(mydata, 2, as.numeric) : object 'mydata' not found
DHW2 <- data.frame(apply(DHW,2,as.numeric))
Warning messages:
1: In apply(DHW, 2, as.numeric) : NAs introduced by coercion
2: In apply(DHW, 2, as.numeric) : NAs introduced by coercion
3: In apply(DHW, 2, as.numeric) : NAs introduced by coercion
4: In apply(DHW, 2, as.numeric) : NAs introduced by coercion
5: In apply(DHW, 2, as.numeric) : NAs introduced by coercion
6: In apply(DHW, 2, as.numeric) : NAs introduced by coercion
I am trying to convert my column V4 to numeric, which is currently in character form. It gives me the above error. I searched a lot for it on online forums & then saw at one place that if the data uses "," as the decimal separator instead of ".", it will always give an error. I have also tried to convert it to dot as the decimal separator but nothing seems to be working out. I just want my column V4 to be converted to numeric values.
Any suggestions would be appreciated.