Make_network error in R Error - “veg_distance” not available for .C() for package “vegan”

萝らか妹 提交于 2019-12-25 01:36:19

问题


I'm getting an error when running make_work from the "vegan" R package:

net <- make_network(ps)

Error in .C("veg_distance", x = as.double(x), nr = N, nc = ncol(x), d = double(N *  : 
"veg_distance" not available for .C() for package "vegan"

Here is my sesion info:

R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

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

other attached packages:
[1] vegan_2.5-1             lattice_0.20-35         permute_0.9-4          
[4] phyloseqGraphTest_0.0.1 ggplot2_2.2.1           phyloseq_1.22.3 

I've seen the other cases related to this error, which advised to uninstall and re-install vegan, which I did (hence the recent update to the package), to no avail.


回答1:


This is most likely an issue with phyloseq interacting with vegan internals -- at least a similar issue has been reported both in vegan and in phyloseq in github. The alternatives seem to be:

  1. You can try if re-installing phyloseq (to the same version) after vegan 2.5-1 update will help: it seems that phyloseq saves the vegan function when it is installed or built (either, I don't know), and it will use that private version even when vegan changes.
  2. Downgrade vegan to 2.4-6 which is the newest version with the old internals (that were also used in phyloseq).
  3. Wait till the issue is fixed in phyloseq.
  4. If possible, try to find a way to go around the problem.



回答2:


I had the same problem (with another function from phyloseq, ordinate()), and think I got it to work. People discussed it in great detail: https://github.com/joey711/phyloseq/issues/921. I'll leave here what has worked for me, after reading cjfields's advice on the page linked above.

# First get stringi straight
install.packages("stringi", configure.args="--disable-pkg-config")
library(stringi)
packageVersion("stringi")
# Vegan
install.packages("vegan")
library(vegan)
packageVersion('vegan') #should be 2.5-1 (or more recent, if someone reads this later)
# Phyloseq. Install the latest version from github (the version on other repos may still have the bug)
library("devtools")
install_github("joey711/phyloseq")
library(phyloseq)
packageVersion('phyloseq')

Before this, I tried downgrading vegan and installing phyloseq again, with no success.




回答3:


Install phyloseq from github. It fixes the issue.

library("devtools")

install_github("joey711/phyloseq")

packageVersion('phyloseq')

[1] ‘1.23.1’




回答4:


I don't know about that R version, but for R 3.3.3, I downgraded to vegan 2.4.2 and this solved it. I also needed to downgrade to ape 4.0 for an ape incompatibility with older phyloseq. I was unable to upgrade phyloseq with devtools due to biocgenerics 0.22 being required.



来源:https://stackoverflow.com/questions/49882886/make-network-error-in-r-error-veg-distance-not-available-for-c-for-packag

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!