Converting Integer Variable to Numeric Variable in R

Working with MLB Player Stats in R, I got stuck plotting and summarizing the runs scored variable. 
I needed to convert the Runs variable from Integer to Numeric. Again I thought this was going to be challenging but it was easy. Just place this code as.numeric(Player$R) at the beginning of the script.
names(Player)
dim(Player)
head(Player)
as.numeric(Player$R)
summary(Player$AVG)
summary(Player$OBP)
summary(Player$OPS)
summary(Player$R)
Advertisements
This entry was posted in Data Cleaning, R. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s