Error : argument ".cols" is missing, with no default ,getting error in shiny
Error : argument ".cols" is missing, with no default ,getting error in shiny
这是我试图在 group_by 函数中计算百分比的指定数据框,
df <- data.frame(Tag = c(1 ,1 ,1 ,1 ,1 ,2 ,2 ,2 ,2 ,2),
YPred = c("L1", "L2" ,"L3", "L4", "L5", "L1", "L2", "L3", "L4", "L5"),
Long = c(1004 , 544 , 545 , 282 , 1 ,2068 ,3006 ,3711 ,2342 , 33),
Medium = c(108, 252, 211, 149, 0, 17, 110, 248, 341, 4),
short = c(58, 118, 131, 73, 4, 0, 43, 150, 189,2),
Urgent = c(5, 70, 65, 24 , 5 ,22 ,18, 31 ,96, 2))
实现百分比的代码group_by
library(dplyr)
group_by(df, Tag) %>%
mutate_at(.vars = vars(Long:Urgent),
.funs = funs(. / sum(., na.rm = TRUE)))
在 reactive function of Shiny
中执行时出现错误,但我在 R 控制台上正确执行。
Error Message
缺少参数“.cols”,没有默认值
@nabi.shaikh 错误不在代码中,我为 dplyr 使用的版本是我确定的旧版本。
> getOption("repos")
CRAN
"https://mran.microsoft.com/snapshot/2017-05-01"
起重机额外
“http://www.stats.ox.ac.uk/pub/RWin”
此外,我从最近的 cran 中通过存储库更新了 dplyr 包。问题解决了。
install.packages("dplyr", repos = "https://cran.rstudio.com/")
这是我试图在 group_by 函数中计算百分比的指定数据框,
df <- data.frame(Tag = c(1 ,1 ,1 ,1 ,1 ,2 ,2 ,2 ,2 ,2),
YPred = c("L1", "L2" ,"L3", "L4", "L5", "L1", "L2", "L3", "L4", "L5"),
Long = c(1004 , 544 , 545 , 282 , 1 ,2068 ,3006 ,3711 ,2342 , 33),
Medium = c(108, 252, 211, 149, 0, 17, 110, 248, 341, 4),
short = c(58, 118, 131, 73, 4, 0, 43, 150, 189,2),
Urgent = c(5, 70, 65, 24 , 5 ,22 ,18, 31 ,96, 2))
实现百分比的代码group_by
library(dplyr)
group_by(df, Tag) %>%
mutate_at(.vars = vars(Long:Urgent),
.funs = funs(. / sum(., na.rm = TRUE)))
在 reactive function of Shiny
中执行时出现错误,但我在 R 控制台上正确执行。
Error Message
缺少参数“.cols”,没有默认值
@nabi.shaikh 错误不在代码中,我为 dplyr 使用的版本是我确定的旧版本。
> getOption("repos")
CRAN
"https://mran.microsoft.com/snapshot/2017-05-01" 起重机额外 “http://www.stats.ox.ac.uk/pub/RWin”
此外,我从最近的 cran 中通过存储库更新了 dplyr 包。问题解决了。
install.packages("dplyr", repos = "https://cran.rstudio.com/")