简体   繁体   English

加载软件包SASxport时出错:'namespace:Hmisc'未导出对象'label <-。data.frame'

[英]Error in loading package SASxport: object ‘label<-.data.frame’ is not exported by 'namespace:Hmisc'

I'm trying to read data in the XPT format into R (the format can be found for example in the NHANES data ). 我正在尝试将XPT格式的数据读入R(例如,可以在NHANES data中找到该格式)。 I found two functions doing this: 我发现有两个功能可以做到这一点:

library("Hmisc")
sasxport.get("C:/path/file.XPT")

and

library("SASxport")
read.xport("C:/path/file.XPT")

The sasxport.get works, so I'm basically fine, but still inquisitive enough to understand (and solve) the following error: after the installation of the SASxport package, I cannot load it. sasxport.get可以正常工作,所以我基本上还可以,但仍然足够好奇以理解(并解决)以下错误:安装SASxport软件包后,我无法加载它。 When I run library("SASxport") , I get the error message: 当我运行library("SASxport") ,出现错误消息:

Error: package or namespace load failed for ‘SASxport’:
 object ‘label<-.data.frame’ is not exported by 'namespace:Hmisc'

Adopting this suggestion , I also ran 通过这个建议 ,我也跑了

remove.packages(c("SASxport", "Hmisc"))
install.packages('Hmisc', dependencies = TRUE)
install.packages('SASxport', dependencies = TRUE)

what did not change the error message. 什么并没有改变错误消息。


This is my sessionInfo() : 这是我的sessionInfo()

R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252    LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C                    LC_TIME=German_Germany.1252    

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

other attached packages:
[1] Hmisc_4.1-1     ggplot2_2.2.1   Formula_1.2-2   survival_2.41-3 lattice_0.20-35

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.14        pillar_1.0.1        compiler_3.4.3      RColorBrewer_1.1-2  plyr_1.8.4         
 [6] base64enc_0.1-3     iterators_1.0.9     tools_3.4.3         rpart_4.1-11        digest_0.6.13      
[11] tibble_1.4.1        gtable_0.2.0        htmlTable_1.11.1    checkmate_1.8.5     rlang_0.1.6        
[16] icenReg_2.0.7       Matrix_1.2-12       foreach_1.4.4       rstudioapi_0.7      yaml_2.1.16        
[21] gridExtra_2.3       coda_0.19-1         stringr_1.2.0       cluster_2.0.6       knitr_1.18         
[26] htmlwidgets_0.9     grid_3.4.3          nnet_7.3-12         data.table_1.10.4-3 foreign_0.8-69     
[31] latticeExtra_0.6-28 magrittr_1.5        scales_0.5.0        backports_1.1.2     codetools_0.2-15   
[36] htmltools_0.3.6     splines_3.4.3       colorspace_1.3-2    stringi_1.1.6       acepack_1.4.1      
[41] lazyeval_0.2.1      munsell_0.4.3   

The last update of SASxport happend nearly two years ago (2016-03-11). SASxport的最新更新发生在大约两年前(2016-03-11)。 So the Hmisc package it imports might have changed in the meantime. 因此,与此同时,它导入的Hmisc软件包可能已更改。 Looking up the Hmisc archive I found the version number on 2016-03-11 to be 3.17-2. 查找Hmisc存档,我发现2016-03-11的版本号为3.17-2。 So installing this version fixes the problem: 因此,安装此版本可解决问题:

library("devtools")
install_version("Hmisc", version = "3.17-2")

Two reasons speak against using SASxport in this case: 在这种情况下,有两个原因反对使用SASxport

  1. You need to use a old version of a package which might happer your work in later steps. 您需要使用软件包的旧版本,这可能会在以后的步骤中影响您的工作。
  2. SASxport needs Hmisc for a task that Hmisc can do already by itself, so SASxport is expendable when reading in XPT files. SASxport需要Hmisc来完成Hmisc本身已经可以完成的任务,因此在读取XPT文件时SASxport会消耗。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 dplyr 时出错:object 'data_frame' 不是由 'namespace:vctrs' 导出的 - Error using dplyr : object ‘data_frame’ is not exported by 'namespace:vctrs' 如何修复R中的“错误:&#39;名称空间:dplyr&#39;未导出对象&#39;as_tibble&#39;错误:包&#39;BLANK&#39;的延迟加载失败” - How to fix “Error : object ‘as_tibble’ is not exported by 'namespace:dplyr' ERROR: lazy loading failed for package ‘BLANK’” in R 在 R 中加载 Lime package 时出现错误“对象 'coef.cv.glmnet' 未由 'namespace:glmnet' 导出” - - error “object ‘coef.cv.glmnet’ is not exported by 'namespace:glmnet' ” while loading Lime package in R - 加载 package ggh4x 时出错:错误:package 或名称空间加载失败 'ggh4x':object 'cli_abort'未导出 - loading the package ggh4x in error: Error: package or namespace load failed for ‘ggh4x’: object ‘cli_abort’ is not exported by 'namespace:cli' “数据”不是从“命名空间:my_package”导出的 object - 'data' is not an exported object from 'namespace:my_package' 使用R中的XLSX包在Excel中打印data.frame时出错 - Error in printing data.frame in excel using XLSX package in R 库中的错误(“Hmisc”):没有名为“Hmisc”的 package - Error in library("Hmisc"): there is no package called 'Hmisc' 错误:“gt”的包或命名空间加载失败:“命名空间:fastmap”未导出对象“faststack” - Error: package or namespace load failed for ‘gt’: object ‘faststack’ is not exported by 'namespace:fastmap' 错误:&#39;arulesViz&#39;的包或名称空间加载失败:对象&#39;cividis&#39;不会被&#39;namespace:viridisLite&#39;导出 - Error: package or namespace load failed for ‘arulesViz’: object ‘cividis’ is not exported by 'namespace:viridisLite' 错误:package 或“tidyverse”的命名空间加载失败:object “relocate”未由“namespace:dplyr”导出 - Error: package or namespace load failed for ‘tidyverse’: object ‘relocate’ is not exported by 'namespace:dplyr'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM