DataCleaner: Function for Cleaning Data for Multiple Comparisons

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

Description

This function takes a data file, 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 that has the numeric values separated by each level of the variable the user wants to compare and a dataframe of the values for easy graphing in another function. There must be column names for this function to work.

Usage

1
DataCleaner(x, fact, respo, warn = TRUE)

Arguments

x

Is a dataframe or other csv file read into R.

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 want to subset by another column use SubsetCleaner() and not DataCleaner().

Value

compare_list

a list containing the level of the fact with the associated respo values

data_frame

a dataframe of the fact and respo values

Author(s)

Selina A. Ruzi

See Also

SubsetCleaner

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 further subset the data, do the following
myCleanData <- DataCleaner(Example_data, fact="Plot", 
                           respo="Seed_removal_percent", 
                           warn=FALSE)

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