Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing a character into a number #92

Open
EmiliaSicari opened this issue Feb 26, 2016 · 1 comment
Open

Changing a character into a number #92

EmiliaSicari opened this issue Feb 26, 2016 · 1 comment

Comments

@EmiliaSicari
Copy link

Rafael and I were wondering if there's a way to convert a character into a number on Rstudio. For example check the data set of "women" included in R: the variables "height" and "weight" are considered characters even though they are numbers; therefore, it's not possible to calculate some statistics!!

Thanks a lot! :)

@christophergandrud
Copy link
Contributor

If you have a data frame called data and a variable called height then use as.numeric like this:

data$height <- as.numeric(data$height)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants