1.4 Discussion Questions
Be prepared to answer the following questions. It is okay (even good!) to use R to discover the answers to these questions.
- What is the class of
happiness
? Why does it make sense to store data using objects of this class? - What is the class of
happiness$shs_tot
? - Why is the
$
needed to reference columns in adata.frame
? - What is the output of
happiness$shs_tot + 2
? - What class is the object produced by executing:
c(happiness$shs_tot, happiness$group)
? - What is the difference between
1
and"1"
in R? - Why does
Happiness$shs_tot + 2
return an error?