Title: | Export R Objects to Several Markup Languages |
---|---|
Description: | Coerce R object to 'asciidoc', 'txt2tags', 'restructuredText', 'org', 'textile' or 'pandoc' syntax. Package comes with a set of drivers for 'Sweave'. |
Authors: | David Hajage [aut], Mark Clements [cre, ctb], Seth Falcon [ctb], Terry Therneau [ctb], Matti Pastell [ctb], Friedrich Leisch [ctb] |
Maintainer: | Mark Clements <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.6 |
Built: | 2024-11-17 04:09:55 UTC |
Source: | https://github.com/mclements/ascii |
Convert an R object to an ascii
object, which can then be
printed with asciidoc, txt2tags, reStructuredText, org, textile or
pandoc syntax.
## S3 method for class 'anova' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'data.frame' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## Default S3 method: ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", list.type = "bullet", ... ) ## S3 method for class 'glm' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'summary.glm' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'describe' ascii(x, condense = TRUE, ...) ## S3 method for class 'summary.formula.response' ascii( x, vnames = c("labels", "names"), prUnits = TRUE, lgroup = list(dimnames(stats)[[1]], if (ul) vlabels else at$vname[at$vname != ""]), n.lgroup = list(1, at$nlevels), include.rownames = FALSE, include.colnames = TRUE, format = "nice", caption = paste(at$ylabel, if (ns > 1) paste(" by", if (ul) at$strat.label else at$strat.name), " N = ", at$n, if (at$nmiss) paste(", ", at$nmiss, " Missing", sep = ""), sep = ""), caption.level = "s", header = TRUE, ... ) ## S3 method for class 'summary.formula.reverse' ascii( x, digits, prn = any(n != N), pctdig = 0, npct = c("numerator", "both", "denominator", "none"), exclude1 = TRUE, vnames = c("labels", "names"), prUnits = TRUE, sep = "/", formatArgs = NULL, round = NULL, prtest = c("P", "stat", "df", "name"), prmsd = FALSE, pdig = 3, eps = 0.001, caption = paste("Descriptive Statistics", if (length(x$group.label)) paste(" by", x$group.label) else paste(" (N = ", x$N, ")", sep = ""), sep = ""), caption.level = "s", include.rownames = FALSE, include.colnames = TRUE, colnames = gl, header = TRUE, lgroup = lgr, n.lgroup = n.lgr, rgroup = rgr, n.rgroup = n.rgr, rstyle = "d", ... ) ## S3 method for class 'summary.formula.cross' ascii( x, twoway = nvar == 2, prnmiss = any(stats$Missing > 0), prn = TRUE, formatArgs = NULL, caption = a$heading, caption.level = "s", include.rownames = FALSE, include.colnames = TRUE, header = TRUE, format = "nice", lgroup = v, n.lgroup = rep(length(z), length(v)), ... ) ## S3 method for class 'htest' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'list' ascii(x, caption = NULL, caption.level = NULL, list.type = "bullet", ...) ## S3 method for class 'packageDescription' ascii(x, caption = NULL, caption.level = NULL, list.type = "label", ...) ## S3 method for class 'sessionInfo' ascii(x, locale = TRUE, ...) ## S3 method for class 'lm' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'summary.lm' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'matrix' ascii( x, include.rownames = FALSE, include.colnames = FALSE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = FALSE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'survfit' ascii( x, scale = 1, print.rmean = getOption("survfit.print.rmean"), rmean = getOption("survfit.rmean"), include.rownames = TRUE, include.colnames = TRUE, header = TRUE, ... ) ## S3 method for class 'table' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'integer' ascii( x, include.rownames = FALSE, include.colnames = FALSE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = FALSE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'numeric' ascii( x, include.rownames = FALSE, include.colnames = FALSE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = FALSE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'character' ascii( x, include.rownames = FALSE, include.colnames = FALSE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = FALSE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'factor' ascii( x, include.rownames = FALSE, include.colnames = FALSE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = FALSE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'proc_time' ascii(x, include.rownames = FALSE, include.colnames = TRUE, ...) ascii(x, ...)
## S3 method for class 'anova' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'data.frame' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## Default S3 method: ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", list.type = "bullet", ... ) ## S3 method for class 'glm' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'summary.glm' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'describe' ascii(x, condense = TRUE, ...) ## S3 method for class 'summary.formula.response' ascii( x, vnames = c("labels", "names"), prUnits = TRUE, lgroup = list(dimnames(stats)[[1]], if (ul) vlabels else at$vname[at$vname != ""]), n.lgroup = list(1, at$nlevels), include.rownames = FALSE, include.colnames = TRUE, format = "nice", caption = paste(at$ylabel, if (ns > 1) paste(" by", if (ul) at$strat.label else at$strat.name), " N = ", at$n, if (at$nmiss) paste(", ", at$nmiss, " Missing", sep = ""), sep = ""), caption.level = "s", header = TRUE, ... ) ## S3 method for class 'summary.formula.reverse' ascii( x, digits, prn = any(n != N), pctdig = 0, npct = c("numerator", "both", "denominator", "none"), exclude1 = TRUE, vnames = c("labels", "names"), prUnits = TRUE, sep = "/", formatArgs = NULL, round = NULL, prtest = c("P", "stat", "df", "name"), prmsd = FALSE, pdig = 3, eps = 0.001, caption = paste("Descriptive Statistics", if (length(x$group.label)) paste(" by", x$group.label) else paste(" (N = ", x$N, ")", sep = ""), sep = ""), caption.level = "s", include.rownames = FALSE, include.colnames = TRUE, colnames = gl, header = TRUE, lgroup = lgr, n.lgroup = n.lgr, rgroup = rgr, n.rgroup = n.rgr, rstyle = "d", ... ) ## S3 method for class 'summary.formula.cross' ascii( x, twoway = nvar == 2, prnmiss = any(stats$Missing > 0), prn = TRUE, formatArgs = NULL, caption = a$heading, caption.level = "s", include.rownames = FALSE, include.colnames = TRUE, header = TRUE, format = "nice", lgroup = v, n.lgroup = rep(length(z), length(v)), ... ) ## S3 method for class 'htest' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'list' ascii(x, caption = NULL, caption.level = NULL, list.type = "bullet", ...) ## S3 method for class 'packageDescription' ascii(x, caption = NULL, caption.level = NULL, list.type = "label", ...) ## S3 method for class 'sessionInfo' ascii(x, locale = TRUE, ...) ## S3 method for class 'lm' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'summary.lm' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'matrix' ascii( x, include.rownames = FALSE, include.colnames = FALSE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = FALSE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'survfit' ascii( x, scale = 1, print.rmean = getOption("survfit.print.rmean"), rmean = getOption("survfit.rmean"), include.rownames = TRUE, include.colnames = TRUE, header = TRUE, ... ) ## S3 method for class 'table' ascii( x, include.rownames = TRUE, include.colnames = TRUE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = TRUE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'integer' ascii( x, include.rownames = FALSE, include.colnames = FALSE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = FALSE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'numeric' ascii( x, include.rownames = FALSE, include.colnames = FALSE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = FALSE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'character' ascii( x, include.rownames = FALSE, include.colnames = FALSE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = FALSE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'factor' ascii( x, include.rownames = FALSE, include.colnames = FALSE, rownames = NULL, colnames = NULL, format = "f", digits = 2, decimal.mark = ".", na.print = "", caption = NULL, caption.level = NULL, width = 0, frame = NULL, grid = NULL, valign = NULL, header = FALSE, footer = FALSE, align = NULL, col.width = 1, style = NULL, tgroup = NULL, n.tgroup = NULL, talign = "c", tvalign = "middle", tstyle = "h", bgroup = NULL, n.bgroup = NULL, balign = "c", bvalign = "middle", bstyle = "h", lgroup = NULL, n.lgroup = NULL, lalign = "c", lvalign = "middle", lstyle = "h", rgroup = NULL, n.rgroup = NULL, ralign = "c", rvalign = "middle", rstyle = "h", ... ) ## S3 method for class 'proc_time' ascii(x, include.rownames = FALSE, include.colnames = TRUE, ...) ascii(x, ...)
x |
An R object of class found among
|
include.rownames |
logical. If |
include.colnames |
logical. If |
rownames |
Character vector (replicated or truncated as necessary)
indicating rownames of the corresponding rows. If |
colnames |
Character vector (replicated or truncated as necessary)
indicating colnames of the corresponding columns. If |
format |
Character vector or matrix indicating the format for the
corresponding columns. These values are passed to the |
digits |
Numeric vector of length equal to the number of columns of
the resulting table (otherwise it will be replicated or truncated as
necessary) indicating the number of digits to display in the
corresponding columns. Default is |
decimal.mark |
The character to be used to indicate the numeric
decimal point. Default is |
na.print |
The character string specifying how |
caption |
Character vector of length 1 containing the table's caption
or title. Set to |
caption.level |
Character or numeric vector of length 1 containing the
caption's level. Can take the following values: |
width |
Numeric vector of length one containing the table width
relative to the available width (expressed as a percentage value,
|
frame |
Character vector of length one. Defines the table border, and
can take the following values: |
grid |
Character vector of length one. Defines which ruler lines are
drawn between table rows and columns, and can take the following values:
|
valign |
Vector or matrix indicating vertical alignment of all cells
in table. Can take the following values: |
header |
logical or numeric. If |
footer |
logical or numeric. If |
align |
Vector or matrix indicating the alignment of the corresponding
columns. Can be composed with |
col.width |
Numeric vector of length equal to the number of columns of
the resulting table (otherwise it will be replicated or truncated as
necessary) indicating width of the corresponding columns (integer
proportional values). Default is |
style |
Character vector or matrix indicating the style of the
corresponding columns. Can be composed with |
tgroup |
Character vector or a list of character vectors defining
major top column headings. The default is to have none ( |
n.tgroup |
A numeric vector or a list of numeric vectors containing
the number of columns for which each element in tgroup is a heading. For
example, specify |
talign |
Character vector of length one defining alignment of major top column headings. |
tvalign |
Character vector of length one defining vertical alignment of major top column headings. |
tstyle |
Character vector of length one indicating the style of major top column headings |
bgroup |
Character vector or list of character vectors defining major
bottom column headings. The default is to have none ( |
n.bgroup |
A numeric vector containing the number of columns for which each element in bgroup is a heading. |
balign |
Character vector of length one defining alignment of major bottom column headings. |
bvalign |
Character vector of length one defining vertical alignment of major bottom column headings. |
bstyle |
Character vector of length one indicating the style of major bottom column headings |
lgroup |
Character vector or list of character vectors defining major
left row headings. The default is to have none ( |
n.lgroup |
A numeric vector containing the number of rows for which
each element in lgroup is a heading. Column names count in the row
numbers if |
lalign |
Character vector of length one defining alignment of major left row headings. |
lvalign |
Character vector of length one defining vertical alignment of major left row headings. |
lstyle |
Character vector of length one indicating the style of major left row headings |
rgroup |
Character vector or list of character vectors defining major
right row headings. The default is to have none ( |
n.rgroup |
A numeric vector containing the number of rows for which
each element in rgroup is a heading. Column names count in the row
numbers if |
ralign |
Character vector of length one defining alignment of major right row headings. |
rvalign |
Character vector of length one defining vertical alignment of major right row headings. |
rstyle |
Character vector of length one indicating the style of major right row headings |
... |
Additional arguments. (Currently ignored.) |
list.type |
Character vector of length one indicating the list type
( |
condense |
default is TRUE to condense the output with regard to the 5
lowest and highest values and the frequency table ( |
vnames |
By default, tables and plots are usually labeled
with variable labels (see |
prUnits |
set to |
prn |
set to |
pctdig |
number of digits to the right of the decimal place
for printing percentages (see |
npct |
specifies which counts are to be printed to the right
of percentages (see |
exclude1 |
by default, |
sep |
character to use to separate quantiles when printing
|
formatArgs |
a list containing other arguments to pass to
|
round |
Specify |
prtest |
a vector of test statistic components to print if
|
prmsd |
set to |
pdig |
number of digits to the right of the decimal place for
printing P-values. (see |
eps |
P-values less than |
twoway |
controls whether the resulting table will be printed
in enumeration format or as a two-way table (the default) (see
|
prnmiss |
set to |
locale |
show locale information? |
scale |
A numeric value to rescale the survival time, e.g., if the
input data to survfit were in days, |
print.rmean |
Option for computation and display of the restricted mean (see |
rmean |
Option for computation and display of the restricted mean (see |
The nature of the generated output depends on the class of
x
. For example, summary.table
objects produce a
bulleted list while data.frame
objects produce a table of
the entire data.frame.
Sometimes, arguments are not active, depending of the features implemented in the markup language generated. All arguments are active when asciidoc syntax is produced.
The available method functions for ascii
are given by
methods(ascii)
. Users can extend the list of available
classes by writing methods for the generic function ascii
.
All method functions should return an object of class
"ascii"
.
This function returns an object of class
"asciiTable"
, "asciiList"
or "asciiMixed"
.
David Hajage [email protected]
op <- options(asciiType = "org") local({x <- 1:10; y <- rnorm(length(x),1+x); ascii(anova(lm(y~x)))}) options(op) op <- options(asciiType = "org") ascii(data.frame(a = 1:3, b = 2), include.rownames = FALSE, digits = 0) options(op) op <- options(asciiType = "org") local({x <- 1:10; y <- rnorm(length(x), 1+x); ascii(glm(y~x)) }) options(op) op <- options(asciiType = "org") local({x <- 1:10; y <- rnorm(length(x), 1+x); ascii(summary(glm(y~x))) }) options(op) op <- options(asciiType = "org") local({x <- rnorm(100); ascii(t.test(x))}) options(op) op <- options(asciiType = "org") ascii(list(a=1,b=2), list.type="label") options(op) op <- options(asciiType = "org") ascii(sessionInfo()) options(op) op <- options(asciiType = "org") local({x <- 1:10; y <- rnorm(length(x), 1+x); ascii(lm(y~x)) }) options(op) op <- options(asciiType = "org") local({x <- 1:10; y <- rnorm(length(x), 1+x); ascii(summary(lm(y~x))) }) options(op) op <- options(asciiType = "org") ascii(matrix(1:4,2,2,FALSE,list(1:2,c("A","B"))), TRUE, TRUE, digits=0) options(op) op <- options(asciiType = "org") ascii(table(rbinom(100,5,.3)), digits=0) options(op) op <- options(asciiType = "org") ascii(c(a=1L,b=2L),FALSE,TRUE,digits=0) options(op) op <- options(asciiType = "org") ascii(seq(0,1,length=11),digits=1) options(op) op <- options(asciiType = "org") ascii(c(a="A",b="B"),FALSE,TRUE,header=TRUE) options(op) op <- options(asciiType = "org") ascii(factor(c("A","B")),FALSE) options(op) op <- options(asciiType = "org") ascii(system.time(sum(1:1e6)), header=TRUE) options(op) data(esoph) ascii(esoph[1:10,]) tab <- table(esoph$agegp, esoph$alcgp) ascii(tab) print(ascii(tab), type = "t2t") print(ascii(tab), type = "rest") print(ascii(tab), type = "org") ascii(summary(tab))
op <- options(asciiType = "org") local({x <- 1:10; y <- rnorm(length(x),1+x); ascii(anova(lm(y~x)))}) options(op) op <- options(asciiType = "org") ascii(data.frame(a = 1:3, b = 2), include.rownames = FALSE, digits = 0) options(op) op <- options(asciiType = "org") local({x <- 1:10; y <- rnorm(length(x), 1+x); ascii(glm(y~x)) }) options(op) op <- options(asciiType = "org") local({x <- 1:10; y <- rnorm(length(x), 1+x); ascii(summary(glm(y~x))) }) options(op) op <- options(asciiType = "org") local({x <- rnorm(100); ascii(t.test(x))}) options(op) op <- options(asciiType = "org") ascii(list(a=1,b=2), list.type="label") options(op) op <- options(asciiType = "org") ascii(sessionInfo()) options(op) op <- options(asciiType = "org") local({x <- 1:10; y <- rnorm(length(x), 1+x); ascii(lm(y~x)) }) options(op) op <- options(asciiType = "org") local({x <- 1:10; y <- rnorm(length(x), 1+x); ascii(summary(lm(y~x))) }) options(op) op <- options(asciiType = "org") ascii(matrix(1:4,2,2,FALSE,list(1:2,c("A","B"))), TRUE, TRUE, digits=0) options(op) op <- options(asciiType = "org") ascii(table(rbinom(100,5,.3)), digits=0) options(op) op <- options(asciiType = "org") ascii(c(a=1L,b=2L),FALSE,TRUE,digits=0) options(op) op <- options(asciiType = "org") ascii(seq(0,1,length=11),digits=1) options(op) op <- options(asciiType = "org") ascii(c(a="A",b="B"),FALSE,TRUE,header=TRUE) options(op) op <- options(asciiType = "org") ascii(factor(c("A","B")),FALSE) options(op) op <- options(asciiType = "org") ascii(system.time(sum(1:1e6)), header=TRUE) options(op) data(esoph) ascii(esoph[1:10,]) tab <- table(esoph$agegp, esoph$alcgp) ascii(tab) print(ascii(tab), type = "t2t") print(ascii(tab), type = "rest") print(ascii(tab), type = "org") ascii(summary(tab))
The default implementation returns an asciiMixed object with the units for the first element.
## S3 method for class 'microbenchmark' ascii(x, unit, order, signif, row.names = FALSE, caption = NULL, ...)
## S3 method for class 'microbenchmark' ascii(x, unit, order, signif, row.names = FALSE, caption = NULL, ...)
x |
an object of class 'microbenchmark' |
unit |
What unit to print the timings in. Default value taken from the option 'microbenchmark.unit' |
order |
If present, order results according to this column of the output. |
signif |
If present, limit the limit of significant digits shown. |
row.names |
Argument passed to ascii |
caption |
logical; if not NULL, then add caption with units specified; otherwise, add units as part of an asciiMixed object. |
... |
Other parameters to pass to ascii for the summary table |
ascii object
Compared with printCoefmat, this drops the quote and right arguments, and adds include.rownames, include.colnames and header default arguments.
asciiCoefmat( x, digits = max(3L, getOption("digits") - 2L), signif.stars = getOption("show.signif.stars"), signif.legend = signif.stars, dig.tst = max(1L, min(5L, digits - 1L)), cs.ind = 1:k, tst.ind = k + 1, zap.ind = integer(), P.values = NULL, has.Pvalue = nc >= 4L && length(cn <- colnames(x)) && substr(cn[nc], 1L, 3L) %in% c("Pr(", "p-v"), eps.Pvalue = .Machine$double.eps, na.print = "NA", include.rownames = TRUE, include.colnames = TRUE, header = TRUE, ... )
asciiCoefmat( x, digits = max(3L, getOption("digits") - 2L), signif.stars = getOption("show.signif.stars"), signif.legend = signif.stars, dig.tst = max(1L, min(5L, digits - 1L)), cs.ind = 1:k, tst.ind = k + 1, zap.ind = integer(), P.values = NULL, has.Pvalue = nc >= 4L && length(cn <- colnames(x)) && substr(cn[nc], 1L, 3L) %in% c("Pr(", "p-v"), eps.Pvalue = .Machine$double.eps, na.print = "NA", include.rownames = TRUE, include.colnames = TRUE, header = TRUE, ... )
x |
coefficient summary table that is suitable for printCoefmat |
digits |
minimum number of significant digits to be used for most numbers. |
signif.stars |
locial; if 'TRUE', P-values are additionally encoded visually as 'significance stars' in order to help scanning of long coefficient tables. It defaults to the 'show.signif.stars' slot of 'options'. |
signif.legend |
logical; if 'TRUE', a legend for the 'significance stars' is printed provided 'signif.stars = TRUE'. |
dig.tst |
minimum number of significant digits for the test statistics, see 'tst.ind'. |
cs.ind |
indices (integer) of column numbers which are (like) *c*oefficients and *s*tandard errors to be formatted together. |
tst.ind |
indices (integer) of column numbers for test statistics. |
zap.ind |
indices (integer) of column numbers which should be formatted by zapsmall, i.e., by 'zapping' values close to 0. |
P.values |
logical or 'NULL'; if 'TRUE', the last column of 'x' is formatted by format.pval as P values. If 'P.values = NULL', the default, it is set to 'TRUE' only if 'options("show.coef.Pvalue")' is 'TRUE' _and_ 'x' has at least 4 columns _and_ the last column name of 'x' starts with '"Pr("'. |
has.Pvalue |
logical; if 'TRUE', the last column of 'x' contains P values; in that case, it is printed if and only if 'P.values' (above) is true. |
eps.Pvalue |
lower threshold for reporting p-values. |
na.print |
a character string to code NA values in printed output. |
include.rownames |
argument passed to ascii |
include.colnames |
argument passed to ascii |
header |
argument passed to ascii |
... |
other argments passed to ascii |
ascii object. This is character, rather than numeric.
Sweave wrappers
Asciidoc( file, driver = RweaveAsciidoc, syntax = SweaveSyntaxNoweb, encoding = "", ... ) T2t(file, driver = RweaveT2t, syntax = SweaveSyntaxNoweb, encoding = "", ...) ReST(file, driver = RweaveReST, syntax = SweaveSyntaxNoweb, encoding = "", ...) Org(file, driver = RweaveOrg, syntax = SweaveSyntaxNoweb, encoding = "", ...) Textile( file, driver = RweaveTextile, syntax = SweaveSyntaxNoweb, encoding = "", ... ) Pandoc( file, driver = RweavePandoc, syntax = SweaveSyntaxNoweb, encoding = "", ... )
Asciidoc( file, driver = RweaveAsciidoc, syntax = SweaveSyntaxNoweb, encoding = "", ... ) T2t(file, driver = RweaveT2t, syntax = SweaveSyntaxNoweb, encoding = "", ...) ReST(file, driver = RweaveReST, syntax = SweaveSyntaxNoweb, encoding = "", ...) Org(file, driver = RweaveOrg, syntax = SweaveSyntaxNoweb, encoding = "", ...) Textile( file, driver = RweaveTextile, syntax = SweaveSyntaxNoweb, encoding = "", ... ) Pandoc( file, driver = RweavePandoc, syntax = SweaveSyntaxNoweb, encoding = "", ... )
file |
Name of Sweave source file. |
driver |
Sweave driver |
syntax |
Sweave syntax |
encoding |
Encoding |
... |
Further arguments passed to the driver's setup function. |
David Hajage [email protected]
## Not run: testfile <- system.file("examples", "Org-test-1.nw", package = "ascii") ## enforce par(ask = FALSE) options(device.ask.default = FALSE) ## create an org file - in the current working directory, getwd(): Org(testfile) Org(testfile, driver=weaverOrg) ## This can be edited in and exported from Org Mode ## End(Not run)
## Not run: testfile <- system.file("examples", "Org-test-1.nw", package = "ascii") ## enforce par(ask = FALSE) options(device.ask.default = FALSE) ## create an org file - in the current working directory, getwd(): Org(testfile) Org(testfile, driver=weaverOrg) ## This can be edited in and exported from Org Mode ## End(Not run)
ascii list generator
show.asciidoc(
x = .self$x,
caption = .self$caption,
caption.level = .self$caption.level,
list.type = .self$list.type
)
print a list with asciidoc markup
show.org(
x = .self$x,
caption = .self$caption,
caption.level = .self$caption.level,
list.type = .self$list.type
)
print a list with org markup
show.pandoc(
x = .self$x,
caption = .self$caption,
caption.level = .self$caption.level,
list.type = .self$list.type
)
print a list with pandoc markup
show.rest(
x = .self$x,
caption = .self$caption,
caption.level = .self$caption.level,
list.type = .self$list.type
)
print a list with rest markup
show.t2t(
x = .self$x,
caption = .self$caption,
caption.level = .self$caption.level,
list.type = .self$list.type
)
print a list with t2t markup
show.textile(
x = .self$x,
caption = .self$caption,
caption.level = .self$caption.level,
list.type = .self$list.type
)
print a list with textile markup
David Hajage
ascii mixed generator
show.asciidoc()
print everything with asciidoc markup
show.org()
print everything with org markup
show.pandoc()
print everything with pandoc markup
show.rest()
print everything with rest markup
show.t2t()
print everything with t2t markup
show.textile()
print everything with textile markup
David Hajage
ascii table generator
show.asciidoc(
x = .self$x,
include.rownames = .self$include.rownames,
include.colnames = .self$include.colnames,
rownames = .self$rownames,
colnames = .self$colnames,
format = .self$format,
digits = .self$digits,
decimal.mark = .self$decimal.mark,
na.print = .self$na.print,
caption = .self$caption,
caption.level = .self$caption.level,
width = .self$width,
frame = .self$frame,
grid = .self$grid,
valign = .self$valign,
header = .self$header,
footer = .self$footer,
align = .self$align,
col.width = .self$col.width,
style = .self$style,
lgroup = .self$lgroup,
n.lgroup = .self$n.lgroup,
lalign = .self$lalign,
lvalign = .self$lvalign,
lstyle = .self$lstyle,
rgroup = .self$rgroup,
n.rgroup = .self$n.rgroup,
ralign = .self$ralign,
rvalign = .self$rvalign,
rstyle = .self$rstyle,
tgroup = .self$tgroup,
n.tgroup = .self$n.tgroup,
talign = .self$talign,
tvalign = .self$tvalign,
tstyle = .self$tstyle,
bgroup = .self$bgroup,
n.bgroup = .self$n.bgroup,
balign = .self$balign,
bvalign = .self$bvalign,
bstyle = .self$bstyle
)
print a table with asciidoc markup
show.org(
x = .self$x,
include.rownames = .self$include.rownames,
include.colnames = .self$include.colnames,
rownames = .self$rownames,
colnames = .self$colnames,
format = .self$format,
digits = .self$digits,
decimal.mark = .self$decimal.mark,
na.print = .self$na.print,
caption = .self$caption,
caption.level = .self$caption.level,
width = .self$width,
frame = .self$frame,
grid = .self$grid,
valign = .self$valign,
header = .self$header,
footer = .self$footer,
align = .self$align,
col.width = .self$col.width,
style = .self$style,
lgroup = .self$lgroup,
n.lgroup = .self$n.lgroup,
lalign = .self$lalign,
lvalign = .self$lvalign,
lstyle = .self$lstyle,
rgroup = .self$rgroup,
n.rgroup = .self$n.rgroup,
ralign = .self$ralign,
rvalign = .self$rvalign,
rstyle = .self$rstyle,
tgroup = .self$tgroup,
n.tgroup = .self$n.tgroup,
talign = .self$talign,
tvalign = .self$tvalign,
tstyle = .self$tstyle,
bgroup = .self$bgroup,
n.bgroup = .self$n.bgroup,
balign = .self$balign,
bvalign = .self$bvalign,
bstyle = .self$bstyle
)
print a table with org-mode markup
show.pandoc(
x = .self$x,
include.rownames = .self$include.rownames,
include.colnames = .self$include.colnames,
rownames = .self$rownames,
colnames = .self$colnames,
format = .self$format,
digits = .self$digits,
decimal.mark = .self$decimal.mark,
na.print = .self$na.print,
caption = .self$caption,
caption.level = .self$caption.level,
width = .self$width,
frame = .self$frame,
grid = .self$grid,
valign = .self$valign,
header = .self$header,
footer = .self$footer,
align = .self$align,
col.width = .self$col.width,
style = .self$style,
lgroup = .self$lgroup,
n.lgroup = .self$n.lgroup,
lalign = .self$lalign,
lvalign = .self$lvalign,
lstyle = .self$lstyle,
rgroup = .self$rgroup,
n.rgroup = .self$n.rgroup,
ralign = .self$ralign,
rvalign = .self$rvalign,
rstyle = .self$rstyle,
tgroup = .self$tgroup,
n.tgroup = .self$n.tgroup,
talign = .self$talign,
tvalign = .self$tvalign,
tstyle = .self$tstyle,
bgroup = .self$bgroup,
n.bgroup = .self$n.bgroup,
balign = .self$balign,
bvalign = .self$bvalign,
bstyle = .self$bstyle
)
print a table with pandoc markup
show.rest(
x = .self$x,
include.rownames = .self$include.rownames,
include.colnames = .self$include.colnames,
rownames = .self$rownames,
colnames = .self$colnames,
format = .self$format,
digits = .self$digits,
decimal.mark = .self$decimal.mark,
na.print = .self$na.print,
caption = .self$caption,
caption.level = .self$caption.level,
width = .self$width,
frame = .self$frame,
grid = .self$grid,
valign = .self$valign,
header = .self$header,
footer = .self$footer,
align = .self$align,
col.width = .self$col.width,
style = .self$style,
lgroup = .self$lgroup,
n.lgroup = .self$n.lgroup,
lalign = .self$lalign,
lvalign = .self$lvalign,
lstyle = .self$lstyle,
rgroup = .self$rgroup,
n.rgroup = .self$n.rgroup,
ralign = .self$ralign,
rvalign = .self$rvalign,
rstyle = .self$rstyle,
tgroup = .self$tgroup,
n.tgroup = .self$n.tgroup,
talign = .self$talign,
tvalign = .self$tvalign,
tstyle = .self$tstyle,
bgroup = .self$bgroup,
n.bgroup = .self$n.bgroup,
balign = .self$balign,
bvalign = .self$bvalign,
bstyle = .self$bstyle
)
print a table with restructuredText markup
show.t2t(
x = .self$x,
include.rownames = .self$include.rownames,
include.colnames = .self$include.colnames,
rownames = .self$rownames,
colnames = .self$colnames,
format = .self$format,
digits = .self$digits,
decimal.mark = .self$decimal.mark,
na.print = .self$na.print,
caption = .self$caption,
caption.level = .self$caption.level,
width = .self$width,
frame = .self$frame,
grid = .self$grid,
valign = .self$valign,
header = .self$header,
footer = .self$footer,
align = .self$align,
col.width = .self$col.width,
style = .self$style,
lgroup = .self$lgroup,
n.lgroup = .self$n.lgroup,
lalign = .self$lalign,
lvalign = .self$lvalign,
lstyle = .self$lstyle,
rgroup = .self$rgroup,
n.rgroup = .self$n.rgroup,
ralign = .self$ralign,
rvalign = .self$rvalign,
rstyle = .self$rstyle,
tgroup = .self$tgroup,
n.tgroup = .self$n.tgroup,
talign = .self$talign,
tvalign = .self$tvalign,
tstyle = .self$tstyle,
bgroup = .self$bgroup,
n.bgroup = .self$n.bgroup,
balign = .self$balign,
bvalign = .self$bvalign,
bstyle = .self$bstyle
)
print a table with txt2tags markup
show.textile(
x = .self$x,
include.rownames = .self$include.rownames,
include.colnames = .self$include.colnames,
rownames = .self$rownames,
colnames = .self$colnames,
format = .self$format,
digits = .self$digits,
decimal.mark = .self$decimal.mark,
na.print = .self$na.print,
caption = .self$caption,
caption.level = .self$caption.level,
width = .self$width,
frame = .self$frame,
grid = .self$grid,
valign = .self$valign,
header = .self$header,
footer = .self$footer,
align = .self$align,
col.width = .self$col.width,
style = .self$style,
lgroup = .self$lgroup,
n.lgroup = .self$n.lgroup,
lalign = .self$lalign,
lvalign = .self$lvalign,
lstyle = .self$lstyle,
rgroup = .self$rgroup,
n.rgroup = .self$n.rgroup,
ralign = .self$ralign,
rvalign = .self$rvalign,
rstyle = .self$rstyle,
tgroup = .self$tgroup,
n.tgroup = .self$n.tgroup,
talign = .self$talign,
tvalign = .self$tvalign,
tstyle = .self$tstyle,
bgroup = .self$bgroup,
n.bgroup = .self$n.bgroup,
balign = .self$balign,
bvalign = .self$bvalign,
bstyle = .self$bstyle
)
print a table with textile markup
David Hajage
Cbind two ascii objects
## S3 method for class 'ascii' cbind( ..., caption = NULL, caption.level = NULL, frame = NULL, grid = NULL, col.width = 1, width = 0 )
## S3 method for class 'ascii' cbind( ..., caption = NULL, caption.level = NULL, frame = NULL, grid = NULL, col.width = 1, width = 0 )
... |
ascii objects |
caption |
see |
caption.level |
see |
frame |
see |
grid |
see |
col.width |
see |
width |
see |
This function binds cols of two ascii table.
An "asciiCbind"
object.
David Hajage
Convert a file with specified backend
convert( i, d = NULL, f = NULL, e = NULL, O = NULL, backend = getOption("asciiBackend"), cygwin = FALSE, open = FALSE )
convert( i, d = NULL, f = NULL, e = NULL, O = NULL, backend = getOption("asciiBackend"), cygwin = FALSE, open = FALSE )
i |
input file |
d |
output directory |
f |
format |
e |
encoding |
O |
other options |
backend |
backend ( |
cygwin |
use cygwin? |
open |
open resulting file? |
This function convert a file with asciidoc, txt2tags or pandoc backend
Nothing
David Hajage
Produce a report
createreport( ..., list = NULL, file = NULL, format = NULL, open = TRUE, backend = getOption("asciiBackend"), encoding = NULL, options = NULL, cygwin = FALSE, title = NULL, author = NULL, email = NULL, date = NULL )
createreport( ..., list = NULL, file = NULL, format = NULL, open = TRUE, backend = getOption("asciiBackend"), encoding = NULL, options = NULL, cygwin = FALSE, title = NULL, author = NULL, email = NULL, date = NULL )
... |
R objects (not used if |
list |
list of R objects |
file |
name of the output file (without extension) |
format |
format of the output file |
open |
open resulting file? |
backend |
backend |
encoding |
encoding |
options |
other options |
cygwin |
use cygwin? |
title |
title of the report |
author |
author of the report |
email |
email of the author |
date |
date |
Produce a report from a list of R objects. This function can be
used directly, or through a Report
object (see
examples). Report$new()
creates a new object,
Report$create()
produce a report. Exportation options can
be specified with Report$nameoftheoption <- option
or
directly in Report$create(nameoftheoption = option)
.
Special objects can be used to create sections (see
?section
), paragraphs (see ?paragraph
), verbatim
environment (see ?verbatim
and to insert figures (see
?fig
) or inline results (see ?sexpr
). Helpers exist:
Report$addSection()
, Report$addParagraph()
,
Report$addVerbatim()
, Report$addFig()
.
It needs a working installation of asciidoc, a2x tool chain, txt2tags and/or pandoc (NB: markdown2pdf uses pandoc with latex).
Nothing
David Hajage
## Not run: op <- options(asciiType = "asciidoc") createreport(head(esoph)) r <- Report$new(author = "David Hajage", email = "dhajage at gmail dot com") r$add(section("First section")) r$addSection("First subsection", 2) r$add(paragraph("The data set has", sexpr(nrow(esoph)), " lines. See yourself:"), esoph) r$addSection("Second subsection: age and alc group", 2) tab <- with(esoph, table(alcgp, agegp)) r$add(ascii(tab), ascii(summary(tab), format = "nice")) r$create() r$format <- "slidy" r$create() r$title <- "R report example" r$author <- "David Hajage" r$email <- "dhajage at gmail dot com" options(asciiType = "pandoc") r$backend <- "pandoc" r$format <- "odt" r$create() r$create(backend = "markdown2pdf", format = "pdf") options(op) ## End(Not run)
## Not run: op <- options(asciiType = "asciidoc") createreport(head(esoph)) r <- Report$new(author = "David Hajage", email = "dhajage at gmail dot com") r$add(section("First section")) r$addSection("First subsection", 2) r$add(paragraph("The data set has", sexpr(nrow(esoph)), " lines. See yourself:"), esoph) r$addSection("Second subsection: age and alc group", 2) tab <- with(esoph, table(alcgp, agegp)) r$add(ascii(tab), ascii(summary(tab), format = "nice")) r$create() r$format <- "slidy" r$create() r$title <- "R report example" r$author <- "David Hajage" r$email <- "dhajage at gmail dot com" options(asciiType = "pandoc") r$backend <- "pandoc" r$format <- "odt" r$create() r$create(backend = "markdown2pdf", format = "pdf") options(op) ## End(Not run)
graph
can be used with export
function to insert an R graphic.
fig(file = NULL, graph = NULL, format = NULL, ...)
fig(file = NULL, graph = NULL, format = NULL, ...)
file |
character string ( |
graph |
a recordedplot, a lattice plot, a ggplot, or an expression producing a plot (optional if the file already exists) |
format |
jpg, png or pdf (or guessed with the file name) |
... |
additional arguments (passed to format options) |
A fig object
David Hajage
out
can be used with export
function to insert an R results
out(x, results = "verbatim")
out(x, results = "verbatim")
x |
an R object |
results |
if |
An out object
David Hajage
paragraph
can be used with export
function to add... a paragraph
paragraph(..., new = TRUE)
paragraph(..., new = TRUE)
... |
strings composing the paragraph |
new |
whether to create a new paragraph or to continue a preceding one |
A paragraph object.
David Hajage
format p values
plim(p, digits = 4)
plim(p, digits = 4)
p |
p values |
digits |
number of digits |
formated p values
David Hajage
Function displaying the asciidoc, txt2tags, reStructuredText, org or
textile code associated with the supplied object of class ascii
.
## S4 method for signature 'asciiCbind' print( x, type = getOption("asciiType"), file = NULL, append = FALSE, escape = FALSE, list.escape = c("\\_", "\\^"), ... ) ## S4 method for signature 'asciiCbind' show(object) ## S4 method for signature 'asciiTable' print( x, type = getOption("asciiType"), file = NULL, append = FALSE, escape = FALSE, list.escape = c("\\_", "\\^"), ... ) ## S4 method for signature 'asciiTable' show(object) ## S4 method for signature 'asciiList' print( x, type = getOption("asciiType"), file = NULL, append = FALSE, escape = FALSE, list.escape = c("\\_", "\\^"), ... ) ## S4 method for signature 'asciiList' show(object) ## S4 method for signature 'asciiMixed' print( x, type = getOption("asciiType"), file = NULL, append = FALSE, escape = FALSE, list.escape = c("\\_", "\\^"), ... ) ## S4 method for signature 'asciiMixed' show(object) ## S4 method for signature 'Report' print(x, help = FALSE, ...) ## S4 method for signature 'Report' show(object)
## S4 method for signature 'asciiCbind' print( x, type = getOption("asciiType"), file = NULL, append = FALSE, escape = FALSE, list.escape = c("\\_", "\\^"), ... ) ## S4 method for signature 'asciiCbind' show(object) ## S4 method for signature 'asciiTable' print( x, type = getOption("asciiType"), file = NULL, append = FALSE, escape = FALSE, list.escape = c("\\_", "\\^"), ... ) ## S4 method for signature 'asciiTable' show(object) ## S4 method for signature 'asciiList' print( x, type = getOption("asciiType"), file = NULL, append = FALSE, escape = FALSE, list.escape = c("\\_", "\\^"), ... ) ## S4 method for signature 'asciiList' show(object) ## S4 method for signature 'asciiMixed' print( x, type = getOption("asciiType"), file = NULL, append = FALSE, escape = FALSE, list.escape = c("\\_", "\\^"), ... ) ## S4 method for signature 'asciiMixed' show(object) ## S4 method for signature 'Report' print(x, help = FALSE, ...) ## S4 method for signature 'Report' show(object)
x |
An object of class |
type |
Type of syntax produce. Possible values for |
file |
A character string naming the file to print to. Default is
|
append |
If |
escape |
If |
list.escape |
Character vector. Default value is |
... |
Additional arguments. (Currently ignored.) |
object |
ascii or Report object |
help |
logical print help? (objects of class |
The package provides the new global option asciiType
. Default value
is "asciidoc"
(see examples).
David Hajage [email protected]
data(esoph) ascii(esoph[1:10,]) print(ascii(esoph[1:10,]), type = "t2t") print(ascii(esoph[1:10,]), type = "rest") print(ascii(esoph[1:10,]), type = "org") print(ascii(esoph[1:10,]), type = "textile") print(ascii(esoph[1:10,]), type = "pandoc") options(asciiType = "rest") ascii(esoph[1:10,]) options(asciiType = "asciidoc")
data(esoph) ascii(esoph[1:10,]) print(ascii(esoph[1:10,]), type = "t2t") print(ascii(esoph[1:10,]), type = "rest") print(ascii(esoph[1:10,]), type = "org") print(ascii(esoph[1:10,]), type = "textile") print(ascii(esoph[1:10,]), type = "pandoc") options(asciiType = "rest") ascii(esoph[1:10,]) options(asciiType = "asciidoc")
Print an graph object
## S3 method for class 'fig' print(x, backend = getOption("asciiBackend"), ...)
## S3 method for class 'fig' print(x, backend = getOption("asciiBackend"), ...)
x |
an graph object |
backend |
ascii backend |
... |
not used |
David Hajage
Print an out object
## S3 method for class 'out' print(x, backend = getOption("asciiBackend"), ...)
## S3 method for class 'out' print(x, backend = getOption("asciiBackend"), ...)
x |
an out object |
backend |
ascii backend |
... |
not used |
David Hajage
Print a paragraph object
## S3 method for class 'paragraph' print(x, ...)
## S3 method for class 'paragraph' print(x, ...)
x |
a paragraph object |
... |
not used |
David Hajage
Print a section object
## S3 method for class 'section' print(x, backend = getOption("asciiBackend"), ...)
## S3 method for class 'section' print(x, backend = getOption("asciiBackend"), ...)
x |
a section object |
backend |
ascii backend |
... |
not used |
David Hajage
Print a sexpr object
## S3 method for class 'sexpr' print(x, ...)
## S3 method for class 'sexpr' print(x, ...)
x |
a sexpr object |
... |
not used |
David Hajage
Print a verbatim object
## S3 method for class 'verbatim' print(x, backend = getOption("asciiBackend"), ...)
## S3 method for class 'verbatim' print(x, backend = getOption("asciiBackend"), ...)
x |
a verbatim object |
backend |
ascii backend |
... |
not used |
David Hajage
section
can be used with export
function to add... a section
section(caption, caption.level = 1)
section(caption, caption.level = 1)
caption |
a string |
caption.level |
caption level |
A section object.
David Hajage
sexpr
can be used with export
function to insert an inline R results
sexpr(x)
sexpr(x)
x |
an R results (of length one) |
A sexpr object.
David Hajage
verbatim
can be used with export
function to add a verbatim paragraph
verbatim(...)
verbatim(...)
... |
strings composing the paragraph (line by line) |
A verbatim object.
David Hajage