p_text2pdf | R Documentation |
p_text
extracts from CRAN the most relevant information related to one or
several packages and print them in a text file which can be tailored to various
formats: *.txt, *.md, *.tex for further treatment.
p_text2md
has preset values for markdown files.
p_text2tex
has preset values for latex files.
p_text2pdf
has preset values for pdf files.
p_text(..., char = NULL, filename = "txtpkgs.txt", dir = ".",
beforetext = "", f_maintext = funmaintext, sep1 = "== ",
sep2 = " ==", eol = "\n", README = TRUE, NEWS = TRUE,
vignettes = TRUE, aftertext = "", editor = FALSE, pager = FALSE,
verbose = TRUE, crandb = get("crandb", envir = .GlobalEnv),
repos = getOption("repos")[1])
p_text2md(..., char = NULL, filename = "mdpkgs.md", dir = ".",
beforetext = funheadermd(), f_maintext = funmaintext, sep1 = "# ",
sep2 = " ", eol = " \n", README = TRUE, NEWS = TRUE,
vignettes = TRUE, aftertext = "", editor = FALSE, pager = FALSE,
verbose = TRUE, crandb = get("crandb", envir = .GlobalEnv),
repos = getOption("repos")[1])
p_text2tex(..., char = NULL, filename = "texpkgs.tex", dir = ".",
beforetext = funheadertex(), f_maintext = funmaintex,
sep1 = "\\section{", sep2 = "}", eol = " \\\\\n",
README = TRUE, NEWS = TRUE, vignettes = TRUE,
aftertext = funfootertex(), editor = FALSE, pager = FALSE,
verbose = TRUE, crandb = get("crandb", envir = .GlobalEnv),
repos = getOption("repos")[1])
p_text2pdf(..., char = NULL, filename = "pdfpkgs.pdf", dir = ".",
beforetext = funheadertex(), f_maintext = funmaintex,
sep1 = "\\section{", sep2 = "}", eol = " \\\\\n",
README = TRUE, NEWS = TRUE, vignettes = TRUE,
aftertext = funfootertex(), cleantex = TRUE, openpdf = FALSE,
verbose = TRUE, crandb = get("crandb", envir = .GlobalEnv),
repos = getOption("repos")[1])
... |
any format recognized by |
char |
(name to) a character vector or a list. Use this argument if
|
filename |
character. The file name with extension. If |
dir |
character. The directory in which the files are read or written.
Default value |
beforetext |
character. The text written at the beginning of the file. |
f_maintext |
function name. The function used to extract the main text from
|
sep1 |
character. The symbols written just before each package name. |
sep2 |
character. The symbols written just after each package name. If used with with mardkdown, add two blank characters at the end to force a new line. |
eol |
character. The end of line for the main text (but not for the header and the footer). "\n" for text, " \n" for rmarkdown, " \\ \n" for latex. |
README |
logical. Write the line related to the README page, if it exists. |
NEWS |
logical. Write the line related to the NEWS page, if it exists. |
vignettes |
logical. Write the lines related to the vignette(s), if they exist. |
aftertext |
character. The text written at the end of the file. |
editor |
logical. Open the text file with |
pager |
logical. Open the text file with |
verbose |
logical. List the generated file(s). |
crandb |
data.frame |
repos |
character. The address of your local CRAN. |
cleantex |
logical. Remove the |
openpdf |
logical. Open the pdf files in the default pdf viewer. |
## In real life, download crandb from CRAN or load it from your directory
## with functions crandb_down() or crandb_load().
## In this example, we use a small file.
crandb_load(system.file("data", "zcrandb.rda", package = "RWsearch"))
## Search in crandb
vec <- s_crandb(search, find, select = "PT") ; vec
lst <- s_crandb_list(thermodynamic, "chemical reaction") ; lst
lst2 <- lapply(lst, function(x) x[1:2]) ; lst2
dir <- file.path(tempdir(), "ptext")
## Generate a txt file
p_text(vec[1:5], filename = "SearchFind.txt", dir = dir,
repos = "https://cloud.r-project.org")
## Generate 2 tex + 2 pdf files (10-20 seconds)
## Try the options cleantex = FALSE and openpdf = TRUE on lst
if (interactive()) {
p_text2pdf(lst2, dir = dir, cleantex = TRUE, openpdf = FALSE,
repos = "https://cloud.r-project.org")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.