用knit2wp编织到wp时,为什么不能正常工作?

时间:2018-10-11 15:49:49

标签: rstudio r-markdown knitr

我正在尝试利用knit2wp并不断出现以下错误。

Error: faultCode:  -32700  faultString:  parse error. not well formed

除了我编写的rmarkdown文档之外,我还尝试了基本的rmarkdown.Rmd文档。

我正在使用以下knit2wp函数。

knit2wp('testdoc.Rmd', postid = "New",
        title = 'Your post title',
        shortcode = c(T, T), action = 'newPost', publish = F
)

我也加载了以下库。

library(RWordPress)
library(knitr)
library(XMLRPC)

我做错了什么,正确的做法是什么?

这是.Rmd文档的最小示例

---
title: "Shiny Test"
author: "Name"
date: "10/11/2018"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r cars}
summary(cars)
```

## Including Plots

You can also embed plots, for example:

```{r pressure, echo=FALSE}
plot(pressure)
```

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

0 个答案:

没有答案