【问题标题】:Error in namespaceExports(ns, exports) on Ubuntu but not WindowsUbuntu 上的 namespaceExports(ns,exports)错误,但不是 Windows
【发布时间】:2016-09-27 13:49:00
【问题描述】:

我刚刚在 AWS 上启动了一个 EC2 服务器,我正在尝试从 github称为'krose/skm'。该软件包在 Windows 上安装没有任何问题,但在 Ubuntu 上没有。已安装所有依赖项。我不明白为什么它可以安装在 Windows 上,但不能安装在 Ubuntu 上。

library(devtools)
install_github('krose/skm')

而上面代码运行的结果是:

Downloading GitHub repo krose/skm@master
from URL https://api.github.com/repos/krose/skm/zipball/master
Installing skm
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet  \
CMD INSTALL '/tmp/RtmpxJg8N7/devtools1b887e511e96/krose-skm-059766b'  \
--library='/usr/local/lib/R/site-library' --install-tests

* installing *source* package ‘skm’ ...
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in namespaceExport(ns, exports) :
undefined exports: skm_umm_stations, skm_ummquery, skm_webquery
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/skm’
Error: Command failed (1)

函数使用 Roxygen2 记录并导出。没有使用 分配功能

这是我的 sessionInfo()

R version 3.2.5 (2016-04-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.4 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
 [1] devtools_1.11.1

loaded via a namespace (and not attached):
 [1] httr_1.1.0    R6_2.1.2      tools_3.2.5   withr_1.0.1   curl_0.9.7
 [6] memoise_1.0.0 git2r_0.14.0  digest_0.6.9

我对 Ubuntu 没有太多经验。

更新:R CMD 检查有以下两个注意事项:

* checking DESCRIPTION meta-information ... NOTE
License components which are templates and need '+ file LICENSE':
  MIT
* checking top-level files ... NOTE
Non-standard file/directory found at top level:
  'README.Rmd'

【问题讨论】:

  • R CMD 检查是在 Windows 上使用 devtool::check() 函数进行的。

标签: r ubuntu namespaces devtools


【解决方案1】:

包中的R 目录被错误命名为r。 Windows 没有注意到差异,因为它对文件和目录名称的大小写差异更加宽容。

【讨论】:

  • 谢谢!只是一个附加说明:它不仅仅是通过将文件夹从小写重命名为大写来解决的,因为 windows/git 仍然将文件夹视为小写。新建一个大写的R文件夹,将文件移动到新文件夹,删除原文件夹再将新文件夹移动到包中。
猜你喜欢
  • 2014-11-02
  • 1970-01-01
  • 2021-01-03
  • 2018-03-12
  • 1970-01-01
  • 1970-01-01
  • 2021-09-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多