Variable names and contents
roads
: The R dataframe containing the original dataroads.2011
: The2011
column of the roads dataframenot.na
: An array of logical that corresponds to the non-NA values of the 2011 columnroads.2011.cleaned
: The2011
column from the roads dataframe with theNA
values removedtotal.2011
: The sum of the2011
valuesroads.num
: The roads dataframe without the first column (just the numerical data)roads.means
: A vector containing the mean value of each rowroads.keep
: A vector of logical that is True for rows for which the mean is less than 2000 (non-outliers)roads2
: The roads dataframe with outliers removedroads.num2
: The roads dataframe with the first column removed (just the numerical data) and the outliers removedroads.means2
: The vector of means with outliers removedroads.num2.rowsums
: The sum of the values in each row with the outliers removed (where a sum of 0 indicates that all values in the row are NA)roads.keep2
: A logical vector used to index the rows for which there is at least one non-NA valueroads3
: The roads dataframe with outliers removed and the rows with allNA
values removedroads.num3
: The roads dataframe with the first column removed (just the numerical data) and the outliers removed, and with rows containing allNA
values removedroads.means3
: The vector of means with outliers removed, and with rows containing allNA
values removedroads.replace.na
: The roads dataframe with outliers removed, the rows with allNA
values removed, and theNA
values replaced with 0impute
: A function that takes a vector withNA
values and a vector with replacement values of the same length, and returns the original vector with the NAs replacedroads.impute.na
: The roads dataframe with outliers removed, the rows with allNA
values removed, and theNA
values replaced with the row mean