从我知道的所有来源(例如here和here)中,R中的块选项eval = FALSE
应该停止代码运行并且只显示代码一个针织文件。但是,我的Rstudio中标有eval = FALSE
的块总是运行。
我不是显示此问题的最佳方式,所以我在下面附上了截图:
尽管选择了选项,但始终会对命令plot(cars)
进行评估。虽然include = FALSE
可以阻止图表显示控制台建议代码仍然执行多次,但我运行R文档。
> plot(cars)
> plot(cars)
> plot(cars)
> plot(cars)
> plot(cars)
>
问题
我已经搜索了一段时间,但没有看到其他人有类似的问题,并且想知道如何防止echo=FALSE
代码块运行。
会话信息
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.12.3 (Sierra)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] qwraps_0.2.2 reshape2_1.4.2 devtools_1.12.0 gridExtra_2.2.1 astsa_1.7
[6] pander_0.6.0 vars_1.5-2 lmtest_0.9-35 strucchange_1.5-1 sandwich_2.3-4
[11] MASS_7.3-45 forecast_7.3 timeDate_3012.100 zoo_1.7-14 urca_1.3-0
[16] tsDyn_0.9-44 tseries_0.10-37 stringr_1.1.0 lubridate_1.6.0 forcats_0.2.0
[21] dplyr_0.5.0 purrr_0.2.2 readr_1.0.0 tidyr_0.6.1 tibble_1.2
[26] ggplot2_2.2.1 tidyverse_1.1.1
loaded via a namespace (and not attached):
[1] httr_1.2.1 jsonlite_1.2 foreach_1.4.3 modelr_0.1.0 assertthat_0.1
[6] highr_0.6 yaml_2.1.14 backports_1.0.5 lattice_0.20-34 quadprog_1.5-5
[11] digest_0.6.12 rvest_0.3.2 colorspace_1.3-2 htmltools_0.3.5 Matrix_1.2-8
[16] plyr_1.8.4 psych_1.6.12 broom_0.4.2 haven_1.0.0 bookdown_0.3
[21] scales_0.4.1 git2r_0.18.0 mgcv_1.8-17 tseriesChaos_0.1-13 withr_1.0.2
[26] nnet_7.3-12 lazyeval_0.2.0 mnormt_1.5-5 magrittr_1.5 readxl_0.1.1
[31] memoise_1.0.0 evaluate_0.10 nlme_3.1-131 xml2_1.1.1 foreign_0.8-67
[36] rsconnect_0.7 tools_3.3.1 hms_0.3 munsell_0.4.3 grid_3.3.1
[41] iterators_1.0.8 htmlwidgets_0.8 base64enc_0.1-3 labeling_0.3 rmarkdown_1.3
[46] gtable_0.2.0 codetools_0.2-15 fracdiff_1.4-2 curl_2.3 DBI_0.5-1
[51] R6_2.2.0 knitr_1.15.1 rprojroot_1.2 stringi_1.1.2 parallel_3.3.1
[56] Rcpp_0.12.9