R | Stats

Upload R Markdown to WordPress

##R markdown to WordPress
In this post we will look into steps to publish R markdown directly into wordpress. Here are the steps:

#1 Packages Needed:
Following packages needs to be installed on R studio

install.packages(“devtools”)
install.packages(“RCurl”)
install.packages(“XML”)
devtools:::install_github(“duncantl/XMLRPC”)
devtools:::install_github(“duncantl/RWordPress”)

#2 Once the packages are installed write the blog or r markdown document:
Once R markdown is completed then to upload the post on wordpress, first ensure RWordPress is loaded

library(RWordPress)

Then connect with your wordpress site with credentials:

options(WordPressLogin = c(user = 'password'), # your user name & password
        WordPressURL = 'http://tabvizexplorer/xmlrpc.php') # your WP url + /xmlrpc.php at the end

#3 Finally use knitr library to create an html code to be uploaded on wordpress

library(knitr)
knit2wp('WP_markdown.Rmd', title = 'How to Upload R Markdown Directly to WordPress', publish = FALSE) # your filename and blog post title

Done! your R markdown is ready to be publish