我一直坚持为什么以下代码在我的机器上崩溃R(在rstudio和基本的R gui中) - 任何帮助都将非常感激!
agegroup state gender score1 bin1 score2 bin2 score3 bin3 score4 bin4
18-25 TX F .15 1 .20 3 .51 2 .23 6
18-25 FL F .34 4 .11 7 .79 1 .64 4
65+ CA M .72 3 .33 9 .84 7 .55 3
46-54 TX M .90 6 .08 1 .15 2 .47 5
46-54 TX F .15 1 .11 7 .76 8 .09 8
我的会话信息:
library(dplyr)
library(lubridate)
dates <- data.frame(date = seq(ymd('2015-01-01'),ymd_hms('2019-06-20 23:00:00'),by = "hour"))
# Run this section a few times (simulate many calls in a shiny app)
for(i in 1:10)
test_df <- dates %>%
mutate(month = month(date),
year = year(date))
更新
我尝试重新安装Rcpp然后重新安装dplyr,但仍然遇到了同样的问题。此外,我还能够在我的mac上重新创建相同的问题。我最终做的是,回滚一个版本的dplyr(0.4.1),重新启动,现在正在按照预期工作。我在崩溃后检查了rstudio日志文件并看到了这个:
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lubridate_1.3.3 dplyr_0.4.2
loaded via a namespace (and not attached):
[1] assertthat_0.1 DBI_0.3.1 digest_0.6.8 magrittr_1.5 memoise_0.2.1 parallel_3.1.3 plyr_1.8.3 R6_2.0.1 Rcpp_0.11.6
[10] stringi_0.4-1 stringr_1.0.0 tools_3.1.3