简体   繁体   English

安装软件包时如何处理错误消息?

[英]How do I deal with an error message while installing a package?

I am brand new to this so please forgive my inexperience...I'm trying to learn.我是全新的,所以请原谅我的经验不足......我正在努力学习。

I'm attempting to install an R package called "Doublet Finder" using the specified code given on the Github site.我正在尝试使用 Github 站点上给出的指定代码安装一个名为“Doublet Finder”的 R 包。

When I do this, I get this error immediately:当我这样做时,我立即收到此错误:

Error in rbind(info, getNamespaceInfo(env, "S3methods")) : number of columns of matrices must match (see arg 2) rbind(info, getNamespaceInfo(env, "S3methods")) 中的错误:矩阵的列数必须匹配(参见参数 2)

Being new to R, I'm not sure what this error means and when I google this something similar comes up and the individual removed and re-installed ALL of their libraries...that seems crazy.作为 R 的新手,我不确定这个错误是什么意思,当我在谷歌上搜索类似的东西时,这个人删除并重新安装了他们所有的库......这似乎很疯狂。 Does anyone have advice on what this could be, how to fix it, or why the package won't install?有没有人对这可能是什么,如何修复它或为什么无法安装软件包有任何建议?

Your problem seems to be fairly similar to this one .您的问题似乎与非常相似。 It might be the case that the dependencies (packages that Doublet Finder relies on) are outdated.可能是依赖项( Doublet Finder 所依赖的包)已过时。 What you can try is to follow these steps to uninstall and reinstall all packages with the hope that by updating packages there isn't a version mismatch.您可以尝试按照以下步骤卸载并重新安装所有软件包,希望通过更新软件包不会出现版本不匹配。

This code is copied from the website above:此代码是从上面的网站复制的:

ip <- as.data.frame(installed.packages(lib.loc = .libPaths()[1]), 
                    stringsAsFactors = FALSE)
head(ip)
str(ip)
path.lib <- unique(ip$LibPath)

# create a vector with all the names of the packages you want to remove
pkgs.to.remove <- ip[,1]
head(pkgs.to.remove)
str(pkgs.to.remove)

sapply(pkgs.to.remove, remove.packages, lib = path.lib)
sapply(pkgs.to.remove, install.packages, lib = path.lib)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM