knitr (version 1.18)

knit2wp: Knit an R Markdown document and post it to WordPress

Description

This function is a wrapper around the RWordPress package. It compiles an R Markdown document to HTML and post the results to WordPress.

Usage

knit2wp(input, title = "A post from knitr", ..., envir = parent.frame(), 
    shortcode = FALSE, action = c("newPost", "editPost", "newPage"), postid, 
    encoding = getOption("encoding"), publish = TRUE)

Arguments

input

the filename of the Rmd document

title

the post title

...

other meta information of the post, e.g. categories = c('R', 'Stats') and mt_keywords = c('knitr', 'wordpress'), etc

envir

the environment in which the code chunks are to be evaluated (for example, parent.frame(), new.env(), or globalenv())

shortcode

a logical vector of length 2: whether to use the shortcode [sourcecode lang='lang'] which can be useful to WordPress.com users for syntax highlighting of source code and output; the first element applies to source code, and the second applies to text output (by default, both are FALSE)

action

to create a new post, update an existing post, or create a new page

postid

if action is editPost, the post id postid must be specified

encoding

the encoding of the input file; see file

publish

whether to publish the post immediately

References

https://yihui.name/knitr/demo/wordpress/

Examples

Run this code
# NOT RUN {
# see the reference
# }

Run the code above in your browser using DataCamp Workspace