Practicing Assignment and Data Types¶
Create a variable called
my_ageand set it equal to your ageCheck the class of
my_ageusing theclass()function.Create a variable called
my_dogand set it equal to the name of your dog. (If you do not have a dog, pretend you do What’s your pretend dog’s name?)What’s the class of
my_dog?Now the weird one. Create a variable called
sevenand assign in the value"7"in quotes. What’s the class of7? Why is it not numeric?What happens if you add
my_ageandseven?To convert
sevento a numeric type, typeseven = as.numeric(seven). Now check it’s class again.Now can you add
my_agetoseven?