【发布时间】:2018-02-22 00:34:07
【问题描述】:
在 Rstudio 版本 (1.0.143) 中。
我正在使用 Rstudio 包项目并在其中使用 Rmarkdown。所有代码文件都在 ./R 文件夹中。所有数据文件都在 ./Data 文件夹中。默认的getwd() 是父文件夹./(包含./R 和./Data)。
我使用 RStudio 中的文件补全工具,我认为它非常有用。但是在 .Rmd 文件中,它不能按预期工作。例如,这里有两种情况:
在 .R 文件中,包含在 ./R 文件夹中。我打开括号和 相对于
getwd(),完成工作符合预期 文件夹,即父文件夹。因此 ./R 中的文件“hello.R”将完成为 "./R/hello.R"在 .Rmd 文件中,也包含在 ./R 文件夹中。我开始一个 R 块。一世 打开括号,完成后没有给我“./R” 文件夹,即使
getwd()给了父级“./”, ./R 中文件“hello.R”的补全给出“hello.R”。
这是已知的错误还是功能?
> sessionInfo()
R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
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
loaded via a namespace (and not attached): [1] Rcpp_0.12.12 compiler_3.4.1 RColorBrewer_1.1-2 plyr_1.8.4 base64enc_0.1-3 tools_3.4.1 rpart_4.1-11 [8] digest_0.6.12 evaluate_0.10.1 tibble_1.3.4 gtable_0.2.0 htmlTable_1.9 checkmate_1.8.3 lattice_0.20-35 [15] rlang_0.1.2 Matrix_1.2-11 gridExtra_2.2.1 stringr_1.2.0 cluster_2.0.6 knitr_1.17 htmlwidgets_0.9 [22] grid_3.4.1 nnet_7.3-12 data.table_1.10.4 survival_2.41-3 foreign_0.8-69 pacman_0.4.6 latticeExtra_0.6-28 [29] Formula_1.2-2 ggplot2_2.2.1 magrittr_1.5 Hmisc_4.0-3 scales_0.5.0 backports_1.1.0 htmltools_0.3.6 [36] splines_3.4.1 colorspace_1.3-2 stringi_1.1.5 acepack_1.4.1 lazyeval_0.2.0 munsell_0.4.3
【问题讨论】:
标签: r rstudio r-markdown