Reputation: 1
Tried this code sapply(df,function(x) as.numeric(as.character(x))), gives an error and is removing all the observation
Upvotes: 0
Views: 30
Reputation: 4425
Try this
df[] <- lapply(df , as.numeric)
Upvotes: 1