Description Usage Arguments Details Value Author(s) References See Also Examples
Transform R objects into Org-mode objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
x |
an object |
row.names |
If If |
inactive |
logical: use inactive timestamps? See http://orgmode.org/manual/Creating-timestamps.html . |
... |
other arguments |
Transforms an object x
into character vectors with Org
markup. Most useful when x
is a data.frame.
toOrg
is meant for snippets of code, not for producing whole
Org documents.
When you work with POSIXt
, make sure that a
potential timezone does not cause trouble: Org does
not support timezones.
A character vector, usually with class org
. In some cases,
class character
is additionally attached.
To save it to a file, use writeLines
.
Enrico Schumann
Org mode manual http://orgmode.org/manual/index.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | toOrg(data.frame(a = 1:3, row.names = LETTERS[1:3]))
## => | row.names | a |
## |-----------+---|
## | A | 1 |
## | B | 2 |
## | C | 3 |
toOrg(data.frame(a = 1:3))
## => | a |
## |---|
## | 1 |
## | 2 |
## | 3 |
toOrg(data.frame(a = 1:3), row.names = TRUE)
## => | row.names | a |
## |-----------+---|
## | 1 | 1 |
## | 2 | 2 |
## | 3 | 3 |
toOrg(data.frame(a = 1:5), row.names = "row numbers")
## => | row numbers | a |
## |-------------+---|
## | 1 | 1 |
## | 2 | 2 |
## | 3 | 3 |
## | 4 | 4 |
## | 5 | 5 |
## Not run:
writeLines(toOrg(data.frame(a = 1:3)), "~/Desktop/my_table.org")
## End(Not run)
## Dates/Times
toOrg(as.Date("2015-01-01")) ## <2015-01-01 Thu>
toOrg(as.Date("2015-01-01"), inactive = TRUE) ## [2015-01-01 Thu]
toOrg(Sys.time()) ## <2017-03-20 Mon 13:23:18>
## Convert Org dates to Date
## see ?strptime: Each input string is processed as far as
## necessary for the format specified: any
## trailing characters are ignored.
d <- toOrg(as.Date("2015-01-01"))
as.Date(d, "<%Y-%m-%d")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.