compileSummary: Compile all Micro or Macro evaluation data

compileSummaryR Documentation

Compile all Micro or Macro evaluation data

Description

This function reads all of the micro evaluation or macro evaluation data and amalgamates it into a single data frame which has an additional column indicating which replicate each row belongs to. This data frame is then written to "microSummary.csv" or "macroSummary.csv".

Usage

compileSummary(
  dataType = c("MicroEvaluation", "MacroEvaluation"),
  replicates = NULL,
  prefix = switch(dataType, MicroEvaluation = "micro", MacroEvaluation = "macro"),
  replicateCol = getEctdColName("Replicate"),
  workingPath = getwd()
)

Arguments

dataType

(Optional) A string that indicates which of the two data types should be read. Must be either "MicroEvaluation" or "MacroEvaluation". Partial matching is used here. See match.arg. Default is "MicroEvaluation"

replicates

(Optional) Which replicates should be compiled. By default, the function will compile all available replicate data at the time

prefix

Prefix to use when searching for files to compile

replicateCol

Replicate column name (given by getEctdColName by default)

workingPath

(Optional) The working directory to be used as the root for the "Micro" and "Macro" evaluation directories. Also the directory in which the compiled summary files will be created. The current working directory is used by default

Details

Builds the path to each existing Micro or Macro file to be compiled. Reads the data for each as text, then paste on a Replicate column name to each text section imported. Write out a "full" dataset as a compilated of the seperate datasets found

Value

CompileSummary does not return a value.

Author(s)

Mike K Smith mstoolkit@googlemail.com

Examples


  ## Not run: 
    # a directory MicroEvaluation need to be there and be full
    # of files matching the pattern micro[0-9]{4}.csv
    compileSummary(dataType = "Micro")

    # a directory MacroEvaluation need to be there and be full
    # of files matching the pattern macro[0-9]{4}.csv
    compileSummary(dataType = "Macro")

  
## End(Not run)

MikeKSmith/MSToolkit documentation built on Feb. 15, 2024, 5:32 p.m.