Learn R Programming

tableParser (version 1.0.2)

prepareMatrix: prepareMatrix

Description

Prepares character matrix content for parsing. Removes empty rows and columns, extends content from plausible grouping cells to sparse cells, collapses multiple header rows, and splits multiple model tables to a list of single model tables.

Usage

prepareMatrix(x, split = FALSE, forceClass = NULL, na.rm = TRUE, legend = NULL)

Value

A character matrix

Arguments

x

character matrix

split

Logical. If TRUE, multi-model matrices are split into a list of single-model matrices.

forceClass

Character. Set matrix-specific handling to one of c("tabled result", "correlation", "matrix, "text").

na.rm

Logical. If TRUE, NA cells are set to empty cells.

legend

Character. Optional, text from table caption and/or footnote for table class specific processing.

Examples

Run this code
# example matrix
x<-cbind(c("","","name","","",""), 
         c("group","name","A","B","","C"), 
         c("value","","1","2","","3"))
x

# apply function
prepareMatrix(x)

Run the code above in your browser using DataLab