Change The Class Of An Object

Want to learn more? I recommend working through: R for Data Science, R Cookbook, and R Graphics Cookbook.

Changing the class of an object is called "casting".

# Create a character string object
number.of.casualties <- "929040"
# Convert it into a numeric object
number.of.casualties <- as.numeric(number.of.casualties)