如何让 R htmlWidgets 在 Windows 10 机器上工作?
How to get R htmlWidgets to work on Windows 10 machine?
我正在努力学习 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 相同。
有人知道这里可能出了什么问题吗?
最佳
卡斯帕
htmlwidgets::scaffoldWidget("mywidget", edit = FALSE)
呢?我对 windows 一无所知,但也许 $EDITOR
系统变量的某些类似物尚未正确设置。
我正在努力学习 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 相同。
有人知道这里可能出了什么问题吗?
最佳 卡斯帕
htmlwidgets::scaffoldWidget("mywidget", edit = FALSE)
呢?我对 windows 一无所知,但也许 $EDITOR
系统变量的某些类似物尚未正确设置。