vegan

Plotting RDA (vegan) in ggplot

寵の児 提交于 2020-01-13 19:18:11
问题 I'm still new to R, trying to learn how to use the library vegan, which I can easily plot in R with the normal plot function. The problem arises when I want to plot the data in ggplot. I know I have to extract the right data from the list I've created, but which and how? The dataset I've been practicing on can be downloaded here https://drive.google.com/file/d/0B1PQGov60aoudVR3dVZBX1VKaHc/view?usp=sharing The code I've been using to get the data transformed is this: library(vegan) library

package ‘vegan’ was installed by an R version with different internals

偶尔善良 提交于 2020-01-05 05:53:29
问题 I have installed R-3.4.4 for Windows (32/64 bit) and RStudio 1.1.442 - Windows Vista/7/8/10. I installed package of vegan 2.4-6. When I try opening it then I get the message: > install.packages("C:/Users/Na Talia/Rpackages/vegan_2.4-6.zip", repos = NULL, type = "win.binary") Installing package into ‘C:/Users/Na Talia/Documents/R/win-library/3.4’ (as ‘lib’ is unspecified) package ‘vegan’ successfully unpacked and MD5 sums checked > library("vegan", lib.loc="~/R/win-library/3.4") Error: package

How to use dissimilarity matrix with function metaMDS?

℡╲_俬逩灬. 提交于 2020-01-03 03:23:07
问题 I have a matrix derived from a table with three original columns: column 1 = site codes, column 2 = species codes and column 3 = biomass weight for each species. The biomass weight of each species in each plot is displayed in the matrix. The matrix can be calculated with one of the three following options (thanks to feedback on an earlier question): reshape::cast(dissimBiom, plot ~ species, value = 'biomass', fun = mean) by(dissimBiom, dissimBiom$biomass, function(x) with(x, table(plot,

follow-up: Plotting ordiellipse function from vegan package onto NMDS plot created in ggplot2

旧街凉风 提交于 2019-12-30 11:29:07
问题 I am trying to do something similar to an old post: plotting - original post For my analysis, I am interested in whether different mammal hosts have different flea communities. The original post I have linked to has 2 different solutions for the ellipses. My problem is when I run both the 1st solution and then the general solution I get vastly different looking plots while I think they should be very similar. Below is my code. My question is: Am I doing something incorrectly or which code

Plotting ordiellipse from vegan package with ggplot2

核能气质少年 提交于 2019-12-25 07:07:35
问题 I am would like to make an NMDS ordination plot using ggplot2 for some data I am working up. There is an excellent example of how to do this from a previous stack overflow thread found here: Plotting ordiellipse function from vegan package onto NMDS plot created in ggplot2 I have attempted to copy this function from this previous thread and use for my data. However, I run into the following error message after I pass the function to R.: Error in array(x, c(length(x), 1L), if (!is.null(names(x

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

R CCA only displaying 4 vectors

允我心安 提交于 2019-12-24 16:56:00
问题 When I try to make a CCA plot, only 4 out of 25 vectors are displayed. So, I start by loading my data... #Load package and Data library(vegan) Species <- read.csv("D:/R/Code/TestSpiders.csv", head = TRUE, row.names = 1) Plants <- read.csv("D:/R/Code/Plants.csv", head = TRUE, row.names = 1) And then, I make use the following code to make the CCA and plot it. #Making the CCA CCA.Plants <- cca(Species, Plants) plot(CCA.Plants) Even though my Plants data has much more than 4 columns (it has 25),

Color-coding 95% confidence ellipses for centroids

喜你入骨 提交于 2019-12-23 07:26:15
问题 I've plotted centroids for a Gower similarity index using the vegan{} package in R and would like to color code the ellipse fills based on factors in my original dataset. The centroids are for Month-Site combinations (and these are the only centroids I want to plot; see data sample below), but I want to color code the ellipses by Month and then, in a second plot, by site, to show differences between factors. At the moment the code looks like this: dat.fac<-dat[,1:7] ##factors dat.mgower <-

Annotate in ggplot2 does not honor newline is a pasted and parsed command

扶醉桌前 提交于 2019-12-22 11:27:18
问题 Question How do I get paste and parse in annotate of ggplot2 to honor a newline (\n) character? Problem and MWE I am trying to reproduce in ggplot2 a stressplot of an NMDS analysis using metaMDS in package vegan. Here is my MWE, followed by the resulting graph. library(ggplot2) library(tibble) library(vegan) set.seed(42) # for reproducibility data(dune) fit <- metaMDS(dune) tib <- tibble(fit$diss, fit$dist, fit$dhat) colnames(tib) <- c("diss", "dist", "dhat") stress <- fit$stress coord_x <-

accumulation curve in R

懵懂的女人 提交于 2019-12-19 04:01:37
问题 I have data of species at 4 sites over several months. I have successfully created accumulation graphs using package vegan in R but I would like to plot all 4 sites on one graph. At first I had a data sheet with all sites and months but the when I plotted specaccum the result was a curve of accumulation of all data regardless of site. Because of this I split each site into a separate data sheet which I loaded into R. In each data sheet the first row is species names and each additional row