Home Comments Thread
New Thread

14 Comments

giscus-bot giscus-bot 2022-12-16 23:03:04
Guest *Peter Hickey* @ 2013-02-11 21:19:41 originally posted:

Thanks Yihue. Just want to add that to install RWordPress on a Mac it is necessary to add 'type = 'source'' to the install.package() call, i.e. install.packages('RWordPress', repos = '<http://www.omegahat.org/R>', type = 'source') as there is no Mac binary available.

yihui yihui 2022-12-16 23:03:17

Good catch. Thanks!

Originally posted on 2013-02-12 22:36:28

giscus-bot giscus-bot 2022-12-16 23:03:05
Guest *gogamza* @ 2013-02-12 14:34:43 originally posted:

Could you add encoding parameter on knit2wp?

yihui yihui 2022-12-16 23:03:16

The encoding issue is tricky in this case, but I have done it in the development version. Please test it. Thanks!

Originally posted on 2013-02-12 20:35:51

giscus-bot giscus-bot 2022-12-16 23:03:17
Guest *gogamza* @ 2013-02-13 00:58:10 originally posted:

I've got error from xml.rpc call when I specify encoding="UTF-8", test.Rmd is also UTF-8 format.

library(RWordPress)
library(knitr)
options(WordpressLogin = c(admin = '****'),
WordpressURL = 'http://freesearch.pe.kr/xmlrpc.php')
knit2wp('test.Rmd', title = '워드프레스 테스트-2', encoding="UTF-8")

R > traceback()
9: stop("faultCode: ", fault$faultCode, " faultString: ", fault$faultString)
8: convertToR(xmlParse(node, asText = TRUE))
7: convertToR(xmlParse(node, asText = TRUE))
6: convertToR(ans)
5: convertToR(ans)
4: xml.rpc(.server, method, as.character(blogid), names(login),
as.character(login), content, as.logical(publish))
3: newPage(content, publish, blogid, login, "metaWeblog.newPost",
.server = .server)
2: getFromNamespace("newPost", "RWordPress")(list(description = content,
title = title, ...)) at utils-conversion.R#116
1: knit2wp("test.Rmd", title = "워드프레스 테스트-2", encoding = "UTF-8")

R > sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=Korean_Korea.949 LC_CTYPE=Korean_Korea.949 LC_MONETARY=Korean_Korea.949
[4] LC_NUMERIC=C LC_TIME=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] knitr_1.0.11 RWordPress_0.2-3

loaded via a namespace (and not attached):
[1] digest_0.6.2 evaluate_0.4.3 formatR_0.7 markdown_0.5.4 RCurl_1.95-3 stringr_0.6.2
[7] tools_2.15.2 XML_3.95-0.1 XMLRPC_0.2-5

but, on my linux box, it works well.

thanks.

yihui yihui 2022-12-16 23:03:18

Yes, it is easy to deal with encodings under Linux, but Windows is just hell.

It is not very convenient for me to test Windows, but you can try to remove line 114 in https://github.com/yihui/knitr/blob/master/R/utils-conversion.R#L114 and see if it works. If it does, please consider sending me a pull request on Github. Thanks!

Originally posted on 2013-02-13 05:48:38

giscus-bot giscus-bot 2022-12-16 23:03:19
Guest *gogamza* @ 2013-02-13 12:07:24 originally posted:

Still have a problem on XMLRPC:::convertToR, but I'm trying to make it work.

giscus-bot giscus-bot 2022-12-16 23:03:05
Guest *Marcus Beck* @ 2013-02-13 16:06:59 originally posted:

I'm curious if the RWordPress package is compatible with R versions 2.14.2 or 2.15.1. I was unsuccessful at installing the package in either versions using the above code on Windows 7.

yihui yihui 2022-12-16 23:03:20

Sorry I do not now. I rarely use Windows and I never use old versions of R. Please upgrade R if possible.

Originally posted on 2013-02-13 19:18:16

giscus-bot giscus-bot 2022-12-16 23:03:06
Guest *stla* @ 2013-03-01 09:43:41 originally posted:

I have just tried to publish an article but the rendering really doesn't work: http://stlablog.wordpress.com/2013/03/01/the-binary-splitting-with-the-r-gmp-package-application-to-the-gauss-hypergeometric-function-2/

yihui yihui 2022-12-16 23:03:21

This is weird. Are all your packages up-to-date? (in particular, the markdown package) https://github.com/yihui/knitr/blob/master/FAQ.md

Originally posted on 2013-03-03 05:48:35

giscus-bot giscus-bot 2022-12-16 23:05:26
Guest *stla* @ 2013-08-15 11:31:06 originally posted:

Hello Yihui. Really nice now: http://stlablog.wordpress.com/2013/08/15/test-2-the-binary-splitting-with-the-r-gmp-package-application-to-the-gauss-hypergeometric-function/
Now I'm just looking for a way to get the Mathjax rendering.

giscus-bot giscus-bot 2022-12-16 23:03:07
Guest *Tyler Rinker* @ 2013-03-17 01:06:12 originally posted:

Yihui I wanted to give this a try and made a http://dl.dropbox.com/u/61803503/wordpress/gradient_wrod_cloud_revisited_Rmd.txt. I then follow your directions and the blog gets published but only with the title and no content. I checked to make sure input was actually there with file.exists(input) and R returns TRUE. I'm currently using a Windows 7 machine. I know this isn't your brand :) but I thought you may have some incite as to what's happening. If I run Knit HTML in RStudio the output looks fine.

yihui yihui 2022-12-16 23:03:22

Sorry I have no idea. You can debug(knit2wp) and try to track the value of content step by step and see what is going on there.

Originally posted on 2013-03-17 19:07:16

giscus-bot giscus-bot 2022-12-16 23:05:23
Guest *Tyler Rinker* @ 2013-03-19 02:39:46 originally posted:

Yihui I think it has to do with how the images are dealt with. It seems they're encoded into the content. Here's the script and what content looks like. What have I done wrong? https://dl.dropbox.com/u/61803503/Errors/post.txt

giscus-bot giscus-bot 2022-12-16 23:03:08
Guest *Michał* @ 2013-05-10 13:27:19 originally posted:

Hi Yihui! Does this post use highlight.js for syntax highlighting? I'm looking for a good wordpress solution.

yihui yihui 2022-12-16 23:05:24

No, my website was built with Jekyll, which uses pygments for syntax highlighting, but I can also use highlight.js if I want.

Originally posted on 2013-05-15 13:38:09

giscus-bot giscus-bot 2022-12-16 23:03:09
Guest *battery* @ 2013-06-11 22:42:57 originally posted:

To try this package: I opened a new clean account in wordpress.com, used most basic R markdown package (default one in Rstudio, without even plots). The code above simply not working for me. Can anybody actually make this work?

I'm getting "Error in convertToR ..... " error.
Maybe it is just because of Windows as one of the commentators above mentioned.
Thanks for the effort though, I wished it had worked for me.

yihui yihui 2022-12-16 23:05:25

Sorry, I have no idea without the full error message. Adding traceback() after you see the error can be helpful too.

Originally posted on 2013-06-12 22:51:10

giscus-bot giscus-bot 2022-12-16 23:03:10
Guest *Robert Cassidy* @ 2013-10-31 00:20:42 originally posted:

Hi Yihui! Great package. Thanks. I am trying to use knitr to publish from RStudio to WordPress.

When I use:

options(WordpressLogin = c(myusername = "mypassword"), WordpressURL = 'http://myusername.wordpress.com/xmlrpc.php')
knit2wp(myRmdfilepath, title = "A post from knitr", shortcode = TRUE, publish = FALSE)

I get an error: "Error: faultCode: 401 faultString: Sorry, you are not allowed to publish posts on this site."

But, if I use the RWordPress function:

newPost(content, publish = FALSE, blogid = 0, login = getOption("WordpressLogin", stop("need a login and password")), .server = 'http://myusername.wordpress.com/xmlrpc.php')

then the content (just some text) is published successfully.

Any idea why the knit2wp is being rejected by the WordPress server?

Thanks for any help.
Rob

giscus-bot giscus-bot 2022-12-16 23:05:30
Guest *Guilherme* @ 2014-12-05 01:53:55 originally posted:

Using https:// instead of http:// at WordpressURL worked for me

giscus-bot giscus-bot 2022-12-16 23:05:31
Guest *Robert Cassidy* @ 2014-12-05 14:10:02 originally posted:

Thanks, Guilherme

giscus-bot giscus-bot 2022-12-16 23:03:10
Guest *YJ* @ 2013-11-19 16:51:28 originally posted:

Hi Yihui, thanks for the post. I tried to install the package, but I received a warning message

Warning: dependency ‘bitops’ is not available and the installation failed.
My R version is 3.0.2 and my OS is OSX 10.8.5
Any idea why the installation doesn't work? Thank you for your time in advance!

yihui yihui 2022-12-16 23:05:27

Sorry, but no. I see it is still on CRAN: http://cran.rstudio.com/web/packages/bitops/

Originally posted on 2013-11-25 04:35:33

giscus-bot giscus-bot 2022-12-16 23:03:11
Guest *Gianluca* @ 2013-11-27 23:19:50 originally posted:

I've tried to install the package on my Linux machine but failed.

install.packages('RWordPress', repos = 'http://www.omegahat.org/R', type = 'source')
Warning in install.packages :
package ‘RWordPress’ is not available (for R version 3.0.2)
Installing package into ‘/home/gianluca/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘XML’, ‘XMLRPC’

trying URL 'http://www.omegahat.org/R/src/contrib/XML_3.98-1.tar.gz'
Content type 'application/x-gzip' length 1543387 bytes (1.5 Mb)
opened URL

downloaded 1.5 Mb

trying URL 'http://www.omegahat.org/R/src/contrib/XMLRPC_0.3-0.tar.gz'
Content type 'application/x-gzip' length 37998 bytes (37 Kb)
opened URL

downloaded 37 Kb

trying URL 'http://www.omegahat.org/R/src/contrib/RWordPress_0.2-3.tar.gz'
Content type 'application/x-gzip' length 65319 bytes (63 Kb)
opened URL

downloaded 63 Kb

  • installing source package ‘XML’ ...
    checking for gcc... gcc
    checking for C compiler default output file name...
    rm: cannot remove 'a.out.dSYM': Is a directory
    a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking how to run the C preprocessor... gcc -E
    checking for sed... /bin/sed
    checking for pkg-config... /usr/bin/pkg-config
    checking for xml2-config... no
    Cannot find xml2-config
    ERROR: configuration failed for package ‘XML’
  • removing ‘/home/gianluca/R/x86_64-pc-linux-gnu-library/3.0/XML’
    Warning in install.packages :
    installation of package ‘XML’ had non-zero exit status
    ERROR: dependency ‘XML’ is not available for package ‘XMLRPC’
  • removing ‘/home/gianluca/R/x86_64-pc-linux-gnu-library/3.0/XMLRPC’
    Warning in install.packages :
    installation of package ‘XMLRPC’ had non-zero exit status
    ERROR: dependency ‘XMLRPC’ is not available for package ‘RWordPress’
  • removing ‘/home/gianluca/R/x86_64-pc-linux-gnu-library/3.0/RWordPress’
    Warning in install.packages :
    installation of package ‘RWordPress’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmputdOCD/downloaded_packages’

Do you have any idea what I'm doing wrong?

giscus-bot giscus-bot 2022-12-16 23:03:12
Guest *Yingjie Hu* @ 2014-01-14 19:24:12 originally posted:

RWordpress package complicates the problem due to so many wild errors. The only function we need is to publish the result from knitr to wordpress. We can use other offline blog editors to do this.
I tried using both knitr and windows live writer, and it was successful.
First, knitr produced HTML file from source code.
Second, I opened HTML file in the browser, copied all contents and pasted in Windows Live Writer.

Third, I clicked "publish" button in Windows Live Writer. Done!! Very simple, isn't it?
I will write a short tutorial in my blog later (though I think the steps are so simple that tutorial is not necessary)

yihui yihui 2022-12-16 23:05:28

I agree that is also one way to go.

Originally posted on 2014-01-19 06:15:58

giscus-bot giscus-bot 2022-12-16 23:05:29
Guest *Neville Andrade* @ 2014-10-13 18:54:25 originally posted:

I don't think this works with an image in it right?

giscus-bot giscus-bot 2022-12-16 23:05:29
Guest *Danny Quah* @ 2014-11-28 17:52:23 originally posted:

This seems to work for me, even with images in the post. After copying all contents into Windows Live Writer, I didn't do a "Publish" but instead copied the HTML code (from the "Source" tab in WLW), and pasted that into my Wordpress Edit Post window. It's ugly but the rendering shows fine http://www.dannyquah.com/writings/technical/2014/11/25/global-data/ I might discover problems later but for now...

giscus-bot giscus-bot 2022-12-16 23:03:13
Guest *dapengde* @ 2014-02-25 21:35:51 originally posted:

Hi, Yihui. This is an excellent package. In this way I have successfully published a post to my blog. There is only one problem: the figure is broken.

The published html code of the figure begins with: 'img src="image/ ....',

but the html code in the htm file generated by knitr (Rstudio) begins with 'img src="data:image/ ....'..

'data' is missing in the published post.

Could you give me some ideas to solve this problem? Thank you!

giscus-bot giscus-bot 2022-12-16 23:03:15
Guest *Gustavo Paterno* @ 2014-12-08 18:08:15 originally posted:

Hi Yihui, thanks a lot for this post! I have a problem with your dropbox solution. I did your configuration:

opts_knit$set(base.url = "https://dl.dropboxusercontent.com/u/42523656/wp/",
base.dir = "Users/Paterno/Dropbox/Public/wp")

But I get this error message:

Quitting from lines 34-36 (p1_reg_lin_sim.Rmd)
Error in setwd(dir) : cannot change working directory

Any ideais about what I am doing wrong?

Thanks,
Gustavo

yihui yihui 2022-12-16 23:05:32

The base.dir is not correct. You probably mean /Users or C:/Users, depending on whether you are using Mac OS X or Windows.

Originally posted on 2014-12-12 03:33:08

Sign in to join the discussion

Sign in with GitHub