TextToTable | R Documentation |
Try to convert a string to a table, by first creating a data frame using read.table
. This can then be coerced to a matrix first, and subsequently to a table. The names of the dimensions can be specified.
TextToTable(x, dimnames = NULL, check.names = FALSE, ...)
x |
the string to be interpreted as table. |
dimnames |
the names of the dimensions. |
check.names |
passed on to |
... |
the dots will be passed to the function |
a table
Andri Signorell <andri@signorell.net>
read.table
, as.table
, as.matrix
txt <- "
Democrat, Independent, Republican
M, 762, 327, 468
F, 484, 239, 477"
(tab <- TextToTable(txt, header=TRUE, sep=",", dimnames=c("gender", "party")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.