From R to WordPress in two easy steps
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’😉
#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”)
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.