InterviewSolution
| 1. |
legendTest <- ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() |
|
Answer» Response: The correct answer is c and a. Both “table” and “xtabs” can be used to accomplish this. “Table” is the one that uses cross-specifying factors to build a contingency table of the counts at each combination of factor levels. Xtabs also CREATES a contingency table(optionally a sparse matrix) from cross-classifying factors, usually contained in a data frame, using a formula interface. List is used as a function to CONSTRUCT, coerce and check for both kinds of R lists. Stem produces a stem and LEAF PLOT of the values. It is used for a different purpose than what is requested here. It uses parameter such as “scale” that can be used to expand the scale of the plot. |
|