Standardization of R data

Asked 1 months ago, Updated 1 months ago, 2 views

I would like to standardize the csv data read by R, but I get the error Error in colMeans(x,na.rm=TRUE): 'x' must be numeric'.When I checked with sapply(d, mode) (d contains the data read.table), it says all the data is numeric and I don't know why this error occurs.
Could you tell me the solution?


2022-09-30 12:07

2 Answers

Try using class() or is.numeric() instead of mode() as you can see in the comment link

2022-09-30 12:07

If d contains characters in the first frame (row1, column1) of the data read.table, why don't you leave it blank?

2022-09-30 12:07

If you have any answers or tips

© 2022 OneMinuteCode. All rights reserved.