I read a CSV of measurements and one column that should be numeric came in as a factor. After as.numeric(df$voltage) the values are small integers like 2, 3, 1 rather than 3.3, 5.0 and 12, and the plot is obviously wrong. No error or warning was shown.
Why does the conversion produce these numbers, what is the correct way to get the original values back, and why did the column become a factor in the first place?




