我正在尝试在CRAN上提出更新我的软件包"antaresRead"。
当我使用 R-devel 的服务"https://win-builder.r-project.org/upload.aspx"来测试我的软件包时,我遇到了这个错误:
test_check("antaresRead")
Error in length(ans$indices) : type must be LANGSXP at this point
Calls: test_check ... eval -> eval -> suppressMessages -> withCallingHandlers
日志在这里
为什么我在这个平台和 R-devel 上会出现此错误?我可以纠正吗?
当我在 R-release 和 R-oldRelease 使用相同的服务时,检查是可以的:
- 重新发布
- 罗尔德发布
使用相同的代码:
- 特拉维斯是 还行
- appVeyor 可以用于 8 种组合
- rhub 对于 8 个平台也可以
- rhub::check(platform = 'debian-gcc-release')
- rhub::check(platform = 'macos-elcapitan-release')
- check_for_cran(Platform = "Windows-x86_64-oldrel")
- check_for_cran(平台 = "Windows-x86_64-patched")
- rhub::check(platform = 'fedora-clang-devel')
- rhub::check(platform = 'Fedora-gcc-devel')
- rhub::check(platform = 'debian-gcc-patched')
- rhub::check(platform = 'debian-gcc-devel')
有没有人遇到过这个错误?如何解决?
我做了什么:
- 下载此处的 Windows R devel 版本 --> R 3.5.0
- 构建并检查我的 x64 的 pacakge
antaresRead
->构建和检查正常 - 构建并检查我的软件包以进行 i386 -->构建正常,但在检查中失败并出现相同的错误
Error in length(ans$indices) : type must be LANGSXP at this point Calls: test_check ... eval -> eval -> suppressMessages -> withCallingHandlers
溶液: - 我的错,这是我的代码,是我的错。
错误来自此代码
districtLinks <- merge(districtLinks, districts[, .(district, x, y)],
by.x = "toDistrict", by.y = "district")
districtLinks有时是空的,对于新版本的R和data.table,这只会在Windows 32bits中引发错误。我之前添加了一个检查。
出现此错误是因为我想将一个空的 data.table 与另一个 data.table 合并。
districtLinks <- merge(districtLinks, districts[, .(district, x, y)],
by.x = "toDistrict", by.y = "district")
我所做的是在合并之前添加检查
if(!dim(districtLinks)[1]==0){
districtLinks <- merge(districtLinks, districts[, .(district, x, y)],
by.x = "toDistrict", by.y = "district")
}