我正在尝试将我的答案提交给漩涡程序(R 编程 - 功能单元)。无论我输入什么答案,即使我知道是正确的,它都会要求我重复这个问题。
例如,
“下面我们将创建一个名为boring_function的函数。该函数将参数x
作为输入,并返回x的值而不修改它。删除x前面的井号,使函数工作!一定要保存这个脚本和进行更改后,在控制台中输入 submit()。”
boring_function <- function(x) {
#x
}
所以我提交:
> boring_function <- function(x) {
x
}
> submit()
它给了我这个错误:
“寻找你的脚本……不完全是!再试一次。确保删除井号,这样函数中的最后一个表达式就是 x。”
如果我跳过这个问题,继续后面的问题,它会做同样的事情。
我需要卸载/重新安装 swirl 包还是有其他问题?
提前致谢。
sessionInfo() 的结果
R version 3.2.5 (2016-04-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252
[3] LC_MONETARY=English_Canada.1252 LC_NUMERIC=C
[5] LC_TIME=English_Canada.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] swirl_2.4.2
loaded via a namespace (and not attached):
[1] httr_1.2.1 magrittr_1.5 R6_2.1.3 tools_3.2.5 RCurl_1.95-4.8
[6] curl_2.0 yaml_2.1.13 crayon_1.3.2 stringi_1.1.1 stringr_1.1.0
[11] digest_0.6.10 testthat_1.0.2 bitops_1.0-6