sjPlot 包有问题吗?
Is there something wrong with the sjPlot package?
我正在尝试使用 sjPlot 包 运行 这段代码 ...
library(sjPlot)
likert_6 <- data.frame(as.factor(sample(1:6, 500, replace=T, prob=c(0.2,0.1,0.1,0.3,0.2,0.1))),
as.factor(sample(1:6, 500, replace=T, prob=c(0.15,0.15,0.3,0.1,0.1,0.2))),
as.factor(sample(1:6, 500, replace=T, prob=c(0.2,0.25,0.05,0.2,0.2,0.2))),
as.factor(sample(1:6, 500, replace=T, prob=c(0.2,0.1,0.1,0.4,0.1,0.1))),
as.factor(sample(1:6, 500, replace=T, prob=c(0.1,0.4,0.1,0.3,0.05,0.15))))
levels_6 <- list(c("Very strongly disagree", "Strongly disagree", "Disagree", "Agree", "Strongly Agree", "Very strongly agree"))
items <- list(c("Q1", "Q2", "Q3", "Q4", "Q5"))
sjp.likert(likert_6, legendLabels=levels_6, barColor="red", axisLabels.x=items, orderBy="pos")
软件包已正确安装,但出现以下错误:
Error in sjp.likert(likert_6, legendLabels = levels_6, barColor = "red", :
could not find function "sjp.likert"
有其他人在 运行 这个 code/package 时遇到这个问题吗?我以前从未使用过它,并查看了网站上的具体说明。
(也许应该只是评论,但看起来很长)
我最好的猜测是您正在查看的文档与您安装的软件包版本不匹配。我可以在网上找到一个 sjp.likert()
函数的 this documentation,但那是针对包版本 2.4.1 的;软件包的当前版本 (2.8.2) 有 plot_likert
,但没有 sjp.likert()
。你是在效仿老例子吗?
sjp.likert() was renamed to plot_likert().
版本 2.6.0(似乎已于 2018 年发布)。
我正在尝试使用 sjPlot 包 运行 这段代码 ...
library(sjPlot)
likert_6 <- data.frame(as.factor(sample(1:6, 500, replace=T, prob=c(0.2,0.1,0.1,0.3,0.2,0.1))),
as.factor(sample(1:6, 500, replace=T, prob=c(0.15,0.15,0.3,0.1,0.1,0.2))),
as.factor(sample(1:6, 500, replace=T, prob=c(0.2,0.25,0.05,0.2,0.2,0.2))),
as.factor(sample(1:6, 500, replace=T, prob=c(0.2,0.1,0.1,0.4,0.1,0.1))),
as.factor(sample(1:6, 500, replace=T, prob=c(0.1,0.4,0.1,0.3,0.05,0.15))))
levels_6 <- list(c("Very strongly disagree", "Strongly disagree", "Disagree", "Agree", "Strongly Agree", "Very strongly agree"))
items <- list(c("Q1", "Q2", "Q3", "Q4", "Q5"))
sjp.likert(likert_6, legendLabels=levels_6, barColor="red", axisLabels.x=items, orderBy="pos")
软件包已正确安装,但出现以下错误:
Error in sjp.likert(likert_6, legendLabels = levels_6, barColor = "red", :
could not find function "sjp.likert"
有其他人在 运行 这个 code/package 时遇到这个问题吗?我以前从未使用过它,并查看了网站上的具体说明。
(也许应该只是评论,但看起来很长)
我最好的猜测是您正在查看的文档与您安装的软件包版本不匹配。我可以在网上找到一个 sjp.likert()
函数的 this documentation,但那是针对包版本 2.4.1 的;软件包的当前版本 (2.8.2) 有 plot_likert
,但没有 sjp.likert()
。你是在效仿老例子吗?
sjp.likert() was renamed to plot_likert().
版本 2.6.0(似乎已于 2018 年发布)。