Fail to install tdplyr package. error: argument is not an environment

Fail to install tdplyr package. error: argument is not an environment

感谢您查看我的第一个 post。请容忍我的格式。

问题摘要:我一直在使用 tdplyr 访问 teradata 数据库,没有任何问题,直到我测试了另一个名为 dplyr.teradata 的软件包以提高性能。但是,由于以下错误消息,我无法再连接到数据库:

Error: package or namespace load failed for 'tdplyr':.onLoad failed in loadNamespace() for 'tdplyr', details: call: parent.env(from) error: argument is not an environment

所以我删除了 dplyr.teradata 包,以为这样可以让我原来的 tdplyr 工作,但我仍然收到上面相同的错误消息。然后我在没有备份的情况下删除了 tdplyr 包,尝试使用下面的原始脚本重新安装:

install.packages('tdplyr',repos=c('https://teradata-download.s3.amazonaws.com','https://cloud.r- 
project.org'))

但是还是因为同样的错误再次安装失败。希望有人可以建议修复。

我的会话信息如下:

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] rlang_0.4.10         teradatasql_17.0.0.8 odbc_1.3.0           dplyr_1.0.2         
 [5] dbplyr_2.0.0         digest_0.6.27        DBI_1.1.0            hms_0.5.3           
 [9] bit64_4.0.5          bit_4.0.4           

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5       rstudioapi_0.13  magrittr_1.5     tidyselect_1.1.0 R6_2.4.1        
 [6] blob_1.2.1       tools_4.0.3      xfun_0.20        tinytex_0.28     ellipsis_0.3.1  
[11] assertthat_0.2.1 tibble_3.0.4     lifecycle_0.2.0  crayon_1.3.4     zip_2.1.1       
[16] purrr_0.3.4      vctrs_0.3.6      glue_1.4.2       openxlsx_4.2.3   stringi_1.5.3   
[21] compiler_4.0.3   pillar_1.4.6     generics_0.0.2   pkgconfig_2.0.3 

自己找到了答案。粘贴下面的答案。

Teradata R 包与 dbplyr v2.0.0 及其更高版本不兼容,后者引入了一些重大更改。要使用 tdplyr,dbplyr 包的版本必须是 v1.4.4。 tdplyr 应使用以下命令从您的终端(对于 Linux 和 Mac)或命令提示符(对于 Windows)安装,直到与 dbplyr v2.0.0 兼容的新版本和其更高版本已发布:

先安装dbplyr v1.4.4。有多种方法可以安装特定版本的 R 包。 Teradata 建议使用以下命令: Rscript -e "remotes::install_version('dbplyr',version='1.4.4',repos='https://cloud.r-project.org')" 注意:对于 运行 以上命令,R 包遥控器应该存在于客户端机器上。

接下来要自动下载并安装 tdplyr 和依赖项,如果不满足最低要求版本,请在 install.packages 的 repos 参数中指定 Teradata R 包存储库和 CRAN。 Rscript -e "install.packages('tdplyr',repos=c('https://teradata-download.s3.amazonaws.com','https://cloud.r-project.org'))"