gpt4 book ai didi

r - knit2wp 错误。无法识别用户名或密码

转载 作者:行者123 更新时间:2023-12-02 00:03:21 25 4
gpt4 key购买 nike

我正在使用knitr包将.Rmd文件发布到wordpress。我第一次从事此类项目并遇到以下错误/问题。任何人都可以帮助确定问题。已经进行了多次谷歌搜索,但似乎没有类似的问题。还尝试使用 newPost 函数来完成此任务,但没有结果。

if (!require('RWordPress'))
install.packages('RWordPress', repos = 'http://www.omegahat.org/R', type = 'source')
library(RWordPress)
options(WordPressLogin = c(username = "*****"),
WordPressURL = "https://mathewanalytics.com/xmlrpc.php")

library(knitr)
knit2wp("Logistic_Regression_Document.Rmd",
title = "Evaluation Logistic Regression in R",
shortcode=TRUE, publish=FALSE )


List of 4
$ results: chr "hide"
$ message: logi FALSE
$ warning: logi FALSE
$ eval : logi FALSE

|.................................................................| 100%
ordinary text without R code


output file: Logistic_Regression_Document.md

Error in getOption("WordpressLogin", stop("need a login and password")) :
need a login and password
In addition: Warning messages:
1: In Ops.factor(1, obs) : '-' not meaningful for factors
2: In Ops.factor(1, obs) : '-' not meaningful for factors
3: In Ops.factor(1, y) : '-' not meaningful for factors

最佳答案

我也遇到了这个问题,结果是变量名的问题。

您正在设置:(注意大写P)

WordPressLogin = c(username = "*****")

但是该函数抛出此错误:

Error in getOption("WordpressLogin", stop("need a login and password"))

因此,如果您设置正确的变量:

options(WordpressLogin = c(username = "*****"),
WordpressURL = "https://mathewanalytics.com/xmlrpc.php")

那你应该没问题。

关于r - knit2wp 错误。无法识别用户名或密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32298417/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com