so I was trying to convert my data fruit veg into numeric
I used class(fruit veg) and it showed [1] data.frame
then I used
my_data_num <- as.numeric(fruitveg)
so it showed this error
Error: 'list' object cannot be coerced to type 'double'
what am I doing wrong??
FJCC
January 11, 2023, 3:14pm
2
You can't convert the entire data frame at once, you have to convert individual columns. Should all of the columns be converted or are there some character or date columns that should not be converted?
fruitveg dataframe was created from
fruit <- g[,'fruit']
veg <- g[,'veg']
fruitveg <- fruit + veg
table(fruitveg)
here g is csv file
system
Closed
February 1, 2023, 3:28pm
5
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.