Homework was scored as follows:
Note: Students were permitted to complete this assignment on paper (without RMarkdown)
Some of the flaws you might observe include:
values of president
variable are not all in the same form. Lincoln’s name is in the form “last, first” while others aren’t.
in office
variable contains two numbers (with sloppy puntuation between them). Either of the following would be an appropriate imrpvement:
in office
into two quantitative variables, perhaps start year
and end year
in office
could be replaced with a generic variable year
with values such as {1861, 1862, 1863, …1791, 1792, …}number of states
is not shown as a number in Lincoln’s case. All values should be “the same kind of thing.” The cleanest solution would likely adopt cases as “president in a year” above so that we can show how many states there were for each year and avoid the ambiguity during Lincoln’s presidency.
Each case is an airport. There are seven (7) variables:
Which of these kinds of names should be wrapped with quotation marks when used in R?
The meaning of “CPS” from the documentation for the CPS85 data table is: “Current Population Survey”
Original Statment:
help(NHANES, package <- "NHANES")
Corrected Statement:
help("NHANES", package = "NHANES")
help("NHANES", package = "NHANES")
Note: the example from the reading suggests the quotes around “NHANES”, though the help function works without the quotes in this case. The bigger problem is the incorrect use of an assignment operator within a named argument. Named arguments should always include an equal sign.
require()
search()