我正在努力通过一个R htmlWidgets教程,我正在发生一个似乎是与Windows 10相关的错误。
以下代码适用于我的Windows 7计算机,但不适用于我的Windows 10计算机:
# libpath
.libPaths("C:/R/R-3.2.4revised/library")
library(htmlwidgets)
library(devtools)
# need to be something in the package
placeholder <- function(x, y) x+y
# generate package
package.skeleton(name = "mywidget", list = c("placeholder"),
environment = .GlobalEnv,
path = ".", force = FALSE,
code_files = character())
# package dir
path <- "C:/Users/kaspe/Desktop/R/practise/htmlWidgets/mywidget"
#devtools::create("mywidget") # create package using devtools
setwd(path) # navigate to package dir
htmlwidgets::scaffoldWidget("mywidget") # create widget scaffolding
devtools::install()
When I am running the command:
> htmlwidgets::scaffoldWidget("mywidget") # create widget scaffolding
它会产生以下错误:
Created boilerplate for widget constructor R/mywidget.R
Error in editor(file = file, title = title) :
argument "name" is missing, with no default
两台机器上的基础R和R-studio相同。
有没有人知道这里可能出现的问题?
最佳卡斯帕
答案 0 :(得分:1)
htmlwidgets::scaffoldWidget("mywidget", edit = FALSE)
怎么样?我对窗口一无所知,但也许$EDITOR
系统变量的某些类似物没有被正确设置。