define variable as numeric

Hello there
For some reasons, R recognized "state_owned" (percentage) as factor variable, but it should be the numeric. I used following code tries to convert it to numeric, however, R gave me the error message, please let me know how can I fixed the problem.

d$State_owned <- numeric(d$State_owned)
Error in numeric(d$State_owned) : invalid 'length' argument

Try as.numeric() instead.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.