read.org.table | R Documentation |
Read an emacs “Org” table (in file
or text
) by
read.table()
.
read.org.table(file, header = TRUE, skip = 0,
encoding = "native", fileEncoding = "", text, quiet=FALSE, ...)
file |
a file name, a |
header |
logical indicating if the org table has header line (in
the usual |
skip |
integer number of initial lines to skip. |
encoding |
to be used in the main
|
fileEncoding |
if |
text |
instead of |
quiet |
|
... |
further arguments passed to |
a data.frame
TODO: It should be easy to extend read.org.table()
to also
work for some of the proposed Markdown formats for tables.
Please write to maintainer("sfsmisc")
or open a
github issue if you are interested.
Org-Mode Manual on tables, https://orgmode.org/manual/Tables.html
Org tutorial for tables, https://orgmode.org/worg/org-tutorials/tables.html
CRAN package ascii
can write org tables.
read.table
t1 <-
"
| a | var2 | C |
|---+------+-----|
| 2 | may | 3.4 |
| 7 | feb | 4.7 |
"
d <- read.org.table(text = t1)
d
stopifnot(dim(d) == c(2, 3),
identical(names(d), c("a", "var2", "C")),
d[,"a"] == c(2,7))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.