ParseUserEnteredTable: Parse data from dataEntry R GUI control

View source: R/ParseUserEnteredTable.R

ParseUserEnteredTableR Documentation

Parse data from dataEntry R GUI control

Description

Takes a raw character matrix returned by dataEntry R GUI control and attempts to parse it to something more friendly such as a numeric matrix.

Usage

ParseUserEnteredTable(
  raw.matrix,
  warn = TRUE,
  want.data.frame = FALSE,
  want.factors = TRUE,
  want.col.names = TRUE,
  want.row.names = FALSE,
  us.format = NULL
)

Arguments

raw.matrix

Character matrix

warn

Whether to show warnings

want.data.frame

logical; should a data.frame be returned instead of a matrix or vector? If the input matrix returns a text matrix, this converted to a dataframe

want.factors

logical; should a text variable be converted to a factor? Ignored if want.data.frame is FALSE

want.col.names

logical; should the first row be interpretted as column names? Ignored if want.data.frame is FALSE

want.row.names

logical; should the first colulm be interpretted as row names? Ignored if want.data.frame is FALSE

us.format

logical; should the U.S. convention be used when parsing dates? Ignored if want.data.frame is FALSE

Details

First removes empty rows and columns. If every entry of the resulting matrix (or vector) is numeric, a matrix without row or column names is returned. If the matrix has row and column names and a value in the [1,1] entry, that entry will be returned as an attribute in the output called "statistic".

Value

if want.data.frame == FALSE, numeric vector or matrix, possibly with an attribute "statistic" if row and column names are present; otherwise, a data.frame

Note

If characters are present in the entire first row (including the [1,1] entry), but the first column has all numeric entries aside from that [1,1] entry, then the resulting matrix will have column names, but no row names. And similarly for the case when the first row is all numeric, but the [1,1] entry is not, the output matrix will have row names, but no column names. to extract both row and column names from the resulting matrix


NumbersInternational/flipTransformations documentation built on Feb. 26, 2024, 6:43 a.m.