View source: R/ParseUserEnteredTable.R
ParseUserEnteredTable | R Documentation |
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.
ParseUserEnteredTable(
raw.matrix,
warn = TRUE,
want.data.frame = FALSE,
want.factors = TRUE,
want.col.names = TRUE,
want.row.names = FALSE,
us.format = NULL
)
raw.matrix |
Character matrix |
warn |
Whether to show warnings |
want.data.frame |
logical; should a |
want.factors |
logical; should a text variable be converted to a factor?
Ignored if |
want.col.names |
logical; should the first row be interpretted as column names?
Ignored if |
want.row.names |
logical; should the first colulm be interpretted as row names?
Ignored if |
us.format |
logical; should the U.S. convention be used when parsing dates?
Ignored if |
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"
.
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
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.