I'm trying to convert character values (including those with decimal values) to numeric but it loses the decimal 0 and just converts it to integer:
results <- c("600.0","600","50","50.0","unknown","300xx300")
df <- data.frame(MIX = results, NUM_ONLY = as.numeric(results))
How can I change it so that it looks like this:
df2<- data.frame(MIX = results ,NUM_ONLY = c("600.0","600","50","50.0",NA,NA))