SubsetCleaner: Function for Subsetting and Cleaning Data for Multiple...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function takes a data file, the user's choice of column to subset the data by, the user's choice of column to do the comparisons by, the user's choice of column for the numeric values, checkes that these columnds are in the correct class and then will output a list separated by subset that has the numeric values separated by each level of the variable the user wants to compare and dataframes based on the number of subset levels of the values for easy graphing in another function. There must be column names for this function to work.

Usage

1
SubsetCleaner(x, sub, fact, respo, warn = TRUE)

Arguments

x

Is a dataframe or other csv file read into R.

sub

The name of a column in x that has the variables in it that you want to subset the data by.sub must be written exactly as how column names appear in x otherwise the function will not work. The function automatically coerces this into having levels.

fact

The name of a column in x that has the variables in it that you want to make the comparisons between. fact must be written exactly as how column names appear in x otherwise the function will not work.

respo

The name of a column in x that has the numerical response. respo must be written exactly as how column names appear in x otherwise the function will not work.

warn

Either TRUE or FALSE, it allows the user to specify whether they want they code to stop if fact does not have factor levels or respo is not of class numeric or integer. The default is warn = TRUE. If warn = FALSE then no error message will be given and fact will be coerced into having factors respresented by unique values or characters in the column and respo will be coerced into class numeric.

Details

The output of this function should be assigned to an object and that object used in the other functions of this package. If you do not want to subset by a column use DataCleaner() and not SubsetCleaner().

Value

sub_compare_list

a list of the sub levels each containing a list with all fact levels with the associated respo values

sub_data_frame

a list of the sub levels each containing a dataframe of the fact and respo values

Author(s)

Selina A. Ruzi

See Also

DataCleaner

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## -- find path
mypath <- system.file("extdata", "Example_data.csv", package="multipleComparisons")

## -- read in data
Example_data <- read.csv(mypath, header=TRUE)
names(Example_data)

## -- If do not want to subset the data, then should use the DataCleaner function
myCleanSubset <- SubsetCleaner(Example_data, fact="Plot", 
                               respo="Seed_removal_percent", sub="Season", 
                               warn=FALSE)

sruzi24/multiple_comparisons documentation built on May 15, 2019, 5:03 a.m.