vegan

resolve metaMDS error : “veg_distance” not available for .C() for package “vegan”

匆匆过客 提交于 2019-12-18 09:04:19
问题 I keep getting the following error when trying to run metaMDS() from the vegan package: my_mds <- vegan::metaMDS(df_species, distance="bray", k=2, trymax=1000, autotransform=TRUE) 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" I have tried: 1. searching online for this error - which yields zero results 2. reducing the size of my data frame to 17 rows and 12 columns 3. clearing all packages from

Why am I missing 2 Environmental Variable vectors from CCA plot in R (vegan package)?

六月ゝ 毕业季﹏ 提交于 2019-12-13 21:48:34
问题 My input file is organized with sample ID as the row name, and each column representing a certain Operational Taxonomic Unit, with the data being a number for Absolute Abundance of that OTU. I set up the csv file with binary dummy variables to indicate the sample as being one of 3 locations (L1, L2, L3) and one of 6 descriptive categories (D1, D2, D3, D4, D5, D6). Each sample has a 1 for both one of the three L categories and one of the 6 D categories, and zeroes for the other 7 categories

User defined function based on step() gives: Error in eval(expr, envir, enclos) : object 'X' not found

偶尔善良 提交于 2019-12-13 14:18:47
问题 I am trying to build a function which wraps around the ordiR2step() function from the vegan package. This function is based on the step() function. This is the code to that works perfectly well outside of a function: install.packages("vegan") require(vegan) data(mite) data(mite.env) #explanatory variables mite.hel = decostand(mite, "hel") #response variable mod0 <- rda(mite.hel ~ 1, mite.env) # Model with intercept only mod1 <- rda(mite.hel ~ ., mite.env) # Model with all explanatory

how to add specnames to rankabuncomp?

孤街浪徒 提交于 2019-12-12 06:08:59
问题 I am trying to add the species names to the rankabuncomp plot. I tried to add specnames = T to the rankabundance function but I get an error. Please help me work around this problem. Thanks a lot. library(vegan) library(BiodiversityR) data(dune.env) data(dune) RankAbun.1 <- rankabundance(dune) RankAbun.1 rankabunplot(RankAbun.1,scale='abundance', addit=FALSE, specnames=c(1,2,3)) rankabuncomp(dune, y=dune.env, factor='Management', scale='proportion', legend=FALSE) #to add specnames

Vegan adonis unbalanced design SS type II or III

▼魔方 西西 提交于 2019-12-11 20:09:56
问题 I am a newbie to multivariate statistics, so please forgive me if this question is naïve, or if I have missed something important. I'd like to know how to deal with an unbalanced design when using adonis. I have a data set of microbial communities present in stream sediment and the factors stream (4 levels), US_DS (2 levels) and season (2 levels) (I have other factors as well but sticking to these for the moment). e.g. code below: dist.L2<-vegdist(L2, mehod=”bray”) adonis(dist.L2~Season

Error in rowSums(x) : 'x' must be an array of at least two dimensions (Vegan:oecosimu)

北慕城南 提交于 2019-12-11 09:28:13
问题 I am trying to use the application oecosimu in Vegan package. library(sna) library(permute) library(lattice) library(vegan) library(bipartite) bio<-read.csv("/home/vicar66/Raw_data/Jan12/98percents_April_16/otu_table/Chapter1/no_bloom_bio_data_L3.txt") rownames(bio)<-bio[,1] bio[,1]<-NULL bio_m<-as.matrix(bio) a<-oecosimu(bio_m,bipartite::C.score,"swap") but I keep having this error message: Attaching package: 'bipartite' The following object is masked from 'package:vegan': nullmodel Error in

R metaMDS ordination distances

左心房为你撑大大i 提交于 2019-12-11 07:44:57
问题 I have been doing some ordinations on a data set that I have of abundances of species at different sampling points. I am using metaMDS in vegan to do this. With this function you can either (1)enter directly the community data (sites in rows and species in columns) and specify what type of distance you want it to use (i.e. jaccard, brays curtis, euclidean, etc.) and the function calls vegdist to do this. On the other hand you can (2)give the metaMDS a distance matrix you have already created,

error while installing vegan in r

纵饮孤独 提交于 2019-12-11 05:50:07
问题 When I tried to install vegan using install.packages("vegan") and using RStudio I am getting the following error message * installing *source* package ‘vegan’ ... ** package ‘vegan’ successfully unpacked and MD5 sums checked ** libs gfortran -fpic -g -O2 -fstack-protector-strong -c cepin.f -o cepin.o /bin/bash: gfortran: command not found /usr/lib/R/etc/Makeconf:157: recipe for target 'cepin.o' failed make: *** [cepin.o] Error 127 ERROR: compilation failed for package ‘vegan’ * removing ‘

Plot points of metaMDS

假装没事ソ 提交于 2019-12-11 01:12:15
问题 I would plot points of a metaMDS using different symbols. I would categorize the sites and plot it as points with different symbols. I have 89 sites and I would group them in 11 groups and then plot it. Do you have any idea how can I do this? Thank you very much. 回答1: Here is a simple example using base plots in vegan . There is more detail in my blog post on the subject. The key is to create a set of plotting characters for the 11 groups ( pchs below) and then index that set of characters

How to draw circle in PCoA results?

倾然丶 夕夏残阳落幕 提交于 2019-12-09 21:27:56
问题 I have results with PC1 and PC2 for all the samples, so that I can draw a scatter plot using PC1 as x and PC2 as y. Now the samples are labeled by another variable, let's say type indicating which sample is case or control. How can I draw a plot as above, with circles covering the responding type . Actually, I am using vegan package. I can draw a plot with metaMDS and ordiplot , but don't know how to make a circle as above. I have tried to read the tutorial, but still have no idea. 回答1: I was