From R to WordPress in two easy steps

[This article was first published on R Code – Geekcologist, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Wanting to post with some regularity in this blog, I needed to have a quick, easy way to do so. Importantly, I wanted to do this for free!

I searched the internet, and found RWordPress. This package does just that, helps the user to post in WordPress (resorting also to knitr).

I will provide here the code I used to do this (which I did not use for this post!):

#Loading required packages
library(knitr)
library(RWordPress)

#Defining login options
options(WordPressLogin = c(your_username = “your_password”),
WordpressURL = ‘https://yourblog.wordpress.com/xmlrpc.php&#8217😉

#Import the Rmd file and update it to WordPress

knit2wp(‘post_blog.Rmd’,
title = ‘title_here’,
publish = FALSE, #not to be published you can later edit it in WordPress
action = “newPost”)

To leave a comment for the author, please follow the link and comment on their blog: R Code – Geekcologist.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)