I have a column of salaries in R. They are salaries with 2 decimal points. When I read them in as a CSV, R recognizes the column as Factors. I can't perform functions such as sum
or subset
to analyze the data. Thus, I changed the column to numeric with the command:
payroll$Total.Earnings <- as.numeric(payroll$Total.Earnings)
However, this drastically changes the amounts of the salaries. For example, a person who made $100381.19
is changed to 86
after I write the command above. What am I doing incorrectly?