Quantcast

rarefy function in vegan, exporting to spreadsheet

classic Classic list List threaded Threaded
4 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

rarefy function in vegan, exporting to spreadsheet

Ansley Silva
Hi,
I have just joined the list and I hope I am submitting a question in the
correct format.

I have species data that I used to make rarefaction curves.  I made my
rarefaction curves based on a dataset where I averaged my traps based on a
predictor variable.  This worked fine, however, now I would like to get the
specific rarefied values and SE so I can use it for my diversity index in a
model.

With my uncollapsed dataset,  I get the error:

Error in if (any(sample > minsample)) warning(gettextf("Requested 'sample'
was larger than smallest site maximum (%d)",  :
  missing value where TRUE/FALSE needed

I think I understand the error itself, but I do not know how to correct for
it.  Essentially I would like to get rarefied values to use in a linear
model, but I am having difficulty extracting these values.  Help is greatly
appreciated.

Thanks,

--
Ansley Silva


*"The clearest way into the Universe is through a forest wilderness." John
Muir*


*Graduate Research Assistant*

*University of Georgia*

*D.B. Warnell School of Forestry and Natural Resources*

*180 East Green Street*

*Athens, GA 30602*

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

rarefy.txt (7K) Download Attachment
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rarefy function in vegan, exporting to spreadsheet

Dorothea Hug Peter
Dear Ansley

I just run the code you provided and it works fine for me. As a result I get:

   AP1-1    AP1-2    AP1-3         AP1-4         AP2-1         AP2-2
S      8     7.757679 8.154923   10.164525  6.1662977  10.252731
se     0     1.376587 1.428898   1.450643    0.6982331  1.630957
attr(,"Subsample")
[1] 33

Have you tried the rarefy function on some model data?
Is your raremax in the correct format when you run the code for your entire dataset?

Regards
Dorothea Hug Peter
________________________________________
De : R-sig-ecology <[hidden email]> de la part de [hidden email] <[hidden email]>
Envoyé : lundi 30 mai 2016 12:00
À : [hidden email]
Objet : R-sig-ecology Digest, Vol 98, Issue 15

Send R-sig-ecology mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
or, via email, send a message with subject or body 'help' to
        [hidden email]

You can reach the person managing the list at
        [hidden email]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-sig-ecology digest..."


Today's Topics:

   1. rarefy function in vegan, exporting to spreadsheet (Ansley Silva)


----------------------------------------------------------------------

Message: 1
Date: Sun, 29 May 2016 14:45:50 -0400
From: Ansley Silva <[hidden email]>
To: [hidden email]
Subject: [R-sig-eco] rarefy function in vegan, exporting to
        spreadsheet
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="utf-8"

Hi,
I have just joined the list and I hope I am submitting a question in the
correct format.

I have species data that I used to make rarefaction curves.  I made my
rarefaction curves based on a dataset where I averaged my traps based on a
predictor variable.  This worked fine, however, now I would like to get the
specific rarefied values and SE so I can use it for my diversity index in a
model.

With my uncollapsed dataset,  I get the error:

Error in if (any(sample > minsample)) warning(gettextf("Requested 'sample'
was larger than smallest site maximum (%d)",  :
  missing value where TRUE/FALSE needed

I think I understand the error itself, but I do not know how to correct for
it.  Essentially I would like to get rarefied values to use in a linear
model, but I am having difficulty extracting these values.  Help is greatly
appreciated.

Thanks,

--
Ansley Silva


*"The clearest way into the Universe is through a forest wilderness." John
Muir*


*Graduate Research Assistant*

*University of Georgia*

*D.B. Warnell School of Forestry and Natural Resources*

*180 East Green Street*

*Athens, GA 30602*
-------------- next part --------------
data<-structure(list(necsur = c(3L, 0L, 0L, 2L, 2L, 1L), necame = c(3L,
1L, 12L, 12L, 9L, 20L), niccar = c(0L, 0L, 0L, 1L, 0L, 0L), nicorb = c(0L,
30L, 31L, 3L, 0L, 48L), nicpus = c(0L, 0L, 0L, 0L, 0L, 0L), nictor = c(0L,
0L, 1L, 0L, 0L, 0L), oicina = c(0L, 0L, 0L, 0L, 0L, 0L), delgib = c(5L,
11L, 126L, 16L, 16L, 68L), cancha = c(0L, 0L, 1L, 2L, 2L, 4L),
    melbis = c(1L, 0L, 0L, 0L, 0L, 0L), atelec = c(0L, 0L, 0L,
    32L, 14L, 1L), copmin = c(0L, 0L, 0L, 0L, 0L, 0L), ontcon = c(0L,
    1L, 3L, 0L, 0L, 6L), ontdep = c(0L, 0L, 0L, 0L, 0L, 0L),
    onthec = c(1L, 28L, 7L, 14L, 0L, 29L), ontstr = c(0L, 1L,
    0L, 2L, 0L, 0L), onttau = c(0L, 0L, 8L, 4L, 0L, 8L), ontpen = c(0L,
    0L, 2L, 6L, 0L, 4L), onttub = c(0L, 0L, 3L, 2L, 0L, 6L),
    ontsub = c(0L, 0L, 0L, 0L, 0L, 0L), ontorp = c(0L, 0L, 0L,
    0L, 0L, 0L), phatri = c(0L, 0L, 0L, 0L, 0L, 1L), phaign = c(0L,
    0L, 0L, 0L, 0L, 0L), phavin = c(0L, 0L, 0L, 0L, 0L, 0L),
    phival = c(0L, 0L, 0L, 0L, 0L, 0L), diccar = c(0L, 0L, 0L,
    0L, 0L, 0L), diggaz = c(0L, 0L, 0L, 0L, 0L, 0L), Phyili = c(0L,
    0L, 0L, 0L, 0L, 0L), phyfor = c(0L, 0L, 0L, 0L, 0L, 0L),
    physps = c(0L, 0L, 0L, 0L, 0L, 0L), dippun = c(0L, 0L, 0L,
    0L, 0L, 0L), diplib = c(0L, 0L, 0L, 0L, 0L, 0L), euehum = c(0L,
    0L, 0L, 0L, 0L, 0L), canvir = c(0L, 2L, 2L, 0L, 0L, 1L),
    phycle = c(0L, 0L, 0L, 0L, 0L, 0L), pseper = c(0L, 0L, 0L,
    0L, 0L, 0L), aphrus = c(0L, 0L, 0L, 0L, 0L, 0L), hybill = c(0L,
    0L, 0L, 0L, 0L, 0L), geobla = c(0L, 0L, 0L, 0L, 0L, 0L),
    geoege = c(0L, 0L, 0L, 0L, 0L, 0L), boltho = c(0L, 0L, 0L,
    0L, 0L, 0L), braalt = c(0L, 0L, 0L, 0L, 0L, 0L), chlery = c(0L,
    0L, 0L, 0L, 0L, 0L), chlema = c(0L, 0L, 0L, 0L, 0L, 0L),
    cyclae = c(0L, 0L, 0L, 0L, 0L, 0L), cyclev = c(0L, 0L, 0L,
    0L, 0L, 0L), dicdil = c(0L, 0L, 0L, 0L, 0L, 0L), dicfur = c(0L,
    0L, 0L, 0L, 0L, 0L), dicpur = c(0L, 0L, 0L, 0L, 0L, 0L),
    galjan = c(0L, 0L, 0L, 0L, 0L, 1L), carvin = c(0L, 0L, 0L,
    0L, 0L, 0L), carsyl = c(0L, 0L, 0L, 0L, 0L, 0L), cargor = c(0L,
    0L, 0L, 0L, 0L, 0L), cyclosig = c(0L, 0L, 0L, 0L, 0L, 0L),
    helnig = c(0L, 0L, 0L, 0L, 0L, 0L), helcla = c(0L, 0L, 0L,
    0L, 0L, 0L), scaqua = c(0L, 0L, 0L, 0L, 0L, 1L), scasub = c(0L,
    0L, 0L, 0L, 0L, 0L), oodama = c(0L, 0L, 0L, 0L, 0L, 0L),
    stemex = c(0L, 0L, 0L, 0L, 0L, 0L), agoalb = c(0L, 0L, 0L,
    0L, 0L, 0L), moctet = c(0L, 0L, 0L, 0L, 0L, 0L), pasmar = c(0L,
    0L, 0L, 0L, 0L, 0L), passub = c(0L, 0L, 0L, 0L, 0L, 0L),
    apesin = c(0L, 0L, 0L, 0L, 0L, 0L), anirus = c(0L, 0L, 0L,
    0L, 0L, 0L), calopa = c(0L, 0L, 0L, 0L, 0L, 0L), harsps = c(0L,
    0L, 0L, 0L, 0L, 0L), copgly = c(0L, 0L, 0L, 0L, 0L, 0L),
    omomon = c(0L, 0L, 4L, 2L, 0L, 2L), omosub = c(0L, 1L, 0L,
    0L, 0L, 0L), trofov = c(0L, 0L, 0L, 0L, 0L, 0L), trouni = c(2L,
    0L, 0L, 0L, 0L, 0L), trotub = c(0L, 0L, 0L, 0L, 0L, 0L),
    troaeq = c(0L, 0L, 0L, 0L, 0L, 0L), troter = c(0L, 1L, 0L,
    0L, 0L, 0L), eusass = c(10L, 2L, 9L, 17L, 16L, 9L), hiscoe = c(0L,
    1L, 43L, 0L, 0L, 1L), hisabb = c(0L, 0L, 0L, 0L, 0L, 0L),
    hisfun = c(0L, 0L, 0L, 0L, 0L, 0L), sappen = c(0L, 0L, 0L,
    0L, 0L, 0L), saplug = c(0L, 0L, 0L, 0L, 0L, 0L), ontnod = c(0L,
    0L, 0L, 0L, 0L, 0L), dercan = c(0L, 0L, 0L, 0L, 0L, 0L),
    cremax = c(8L, 0L, 0L, 0L, 0L, 4L), plamac = c(0L, 1L, 5L,
    1L, 0L, 0L), ontcin = c(0L, 0L, 0L, 0L, 0L, 0L), plafem = c(0L,
    0L, 0L, 0L, 0L, 0L), plafos = c(0L, 0L, 0L, 1L, 0L, 1L),
    placom = c(0L, 10L, 0L, 45L, 33L, 4L), placin = c(0L, 0L,
    0L, 0L, 0L, 0L), plapra = c(0L, 0L, 0L, 0L, 0L, 0L), phiumb = c(0L,
    0L, 0L, 0L, 0L, 0L), tacfim = c(0L, 0L, 0L, 0L, 0L, 0L),
    alesps = c(0L, 0L, 0L, 0L, 0L, 0L), tetcar = c(0L, 0L, 0L,
    0L, 0L, 1L), tetvir = c(0L, 0L, 0L, 0L, 0L, 0L), cicsex = c(0L,
    0L, 0L, 0L, 0L, 0L), spsA = c(0L, 0L, 0L, 0L, 0L, 0L), spsB = c(0L,
    0L, 0L, 0L, 0L, 0L), spsC = c(0L, 0L, 0L, 0L, 0L, 0L), spsD = c(0L,
    0L, 0L, 0L, 0L, 0L), spsE = c(0L, 0L, 0L, 0L, 0L, 0L), spsF = c(0L,
    0L, 0L, 0L, 0L, 0L), spsG = c(0L, 0L, 0L, 0L, 0L, 0L), spsH = c(0L,
    0L, 0L, 0L, 0L, 0L), spsI = c(0L, 0L, 0L, 0L, 0L, 0L), spsJ = c(0L,
    0L, 0L, 0L, 0L, 0L), spsK = c(0L, 0L, 0L, 0L, 0L, 0L), spsL = c(0L,
    0L, 0L, 0L, 0L, 0L), spsM = c(0L, 0L, 0L, 0L, 0L, 0L), spsN = c(0L,
    0L, 0L, 0L, 0L, 0L)), .Names = c("necsur", "necame", "niccar",
"nicorb", "nicpus", "nictor", "oicina", "delgib", "cancha", "melbis",
"atelec", "copmin", "ontcon", "ontdep", "onthec", "ontstr", "onttau",
"ontpen", "onttub", "ontsub", "ontorp", "phatri", "phaign", "phavin",
"phival", "diccar", "diggaz", "Phyili", "phyfor", "physps", "dippun",
"diplib", "euehum", "canvir", "phycle", "pseper", "aphrus", "hybill",
"geobla", "geoege", "boltho", "braalt", "chlery", "chlema", "cyclae",
"cyclev", "dicdil", "dicfur", "dicpur", "galjan", "carvin", "carsyl",
"cargor", "cyclosig", "helnig", "helcla", "scaqua", "scasub",
"oodama", "stemex", "agoalb", "moctet", "pasmar", "passub", "apesin",
"anirus", "calopa", "harsps", "copgly", "omomon", "omosub", "trofov",
"trouni", "trotub", "troaeq", "troter", "eusass", "hiscoe", "hisabb",
"hisfun", "sappen", "saplug", "ontnod", "dercan", "cremax", "plamac",
"ontcin", "plafem", "plafos", "placom", "placin", "plapra", "phiumb",
"tacfim", "alesps", "tetcar", "tetvir", "cicsex", "spsA", "spsB",
"spsC", "spsD", "spsE", "spsF", "spsG", "spsH", "spsI", "spsJ",
"spsK", "spsL", "spsM", "spsN"), row.names = c("AP1-1", "AP1-2",
"AP1-3", "AP1-4", "AP2-1", "AP2-2"), class = "data.frame")

raremax<-min(rowSums(apst))
apstrare<-rarefy(apst, raremax, se=TRUE)

------------------------------

Subject: Digest Footer

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

------------------------------

End of R-sig-ecology Digest, Vol 98, Issue 15

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Permanova result interpretation

Tingting Chen
Dear list,

I have did  PCoA, UPGMA cluster analysis, and adonis on my data. And I got
no clear separation on the PCoA plot and clustering. However the Permanova
test is giving a very small P value. In this case, can I say these two
groups are significantly different?

Thank you very much for any help.

Best,
Tingting


Call:
adonis(formula = mat ~ Condition, data = meta, permutations = 9999)

Permutation: free
Number of permutations: 9999

Terms added sequentially (first to last)

          Df SumsOfSqs  MeanSqs F.Model      R2 Pr(>F)
Condition  1   0.23217 0.232167  6.3284 0.14606  1e-04 ***
Residuals 37   1.35740 0.036686         0.85394
Total     38   1.58956                  1.00000
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
--------------------

Tingting Chen

PhD candidate

Whistler Center for Carbohydrate Research

Department of Food Science

Purdue University

745 Agriculture Mall Drive

West Lafayette, IN 47907

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Permanova result interpretation

Zoltan Botta-Dukat-2
Dear Tingting,

If you tested an a priori grouping by adonis, you can say that these
groups significantly different. It means that their difference is bigger
than the random expectation (= exepected difference between random
groups with same size).

However, PCoA and UPGMA results indicates that this is not the best
grouping, i.e. there may be grouping where two groups are more separated.

Best wishes

Zoltan

2016.06.06. 21:32 keltezéssel, Tingting Chen írta:

> Dear list,
>
> I have did  PCoA, UPGMA cluster analysis, and adonis on my data. And I got
> no clear separation on the PCoA plot and clustering. However the Permanova
> test is giving a very small P value. In this case, can I say these two
> groups are significantly different?
>
> Thank you very much for any help.
>
> Best,
> Tingting
>
>
> Call:
> adonis(formula = mat ~ Condition, data = meta, permutations = 9999)
>
> Permutation: free
> Number of permutations: 9999
>
> Terms added sequentially (first to last)
>
>            Df SumsOfSqs  MeanSqs F.Model      R2 Pr(>F)
> Condition  1   0.23217 0.232167  6.3284 0.14606  1e-04 ***
> Residuals 37   1.35740 0.036686         0.85394
> Total     38   1.58956                  1.00000
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> --------------------
>
> Tingting Chen
>
> PhD candidate
>
> Whistler Center for Carbohydrate Research
>
> Department of Food Science
>
> Purdue University
>
> 745 Agriculture Mall Drive
>
> West Lafayette, IN 47907
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


--
Botta-Dukát Zoltán
--------------------------------
Ökológiai és Botanikai Intézet
Magyar Tudományos Akadémia
Ökológiai Kutatóközpont
--------------------------------
2163. Vácrátót, Alkotmány u. 2-4.
tel: +36 28 360122/157
fax: +36 28 360110
[hidden email]
www.okologia.mta.hu


Zoltán BOTTA-Dukát
--------------------------------
Institute of Ecology and Botany
Hungarian Academy of Sciences
Centre for Ecological Research
--------------------------------
H-2163 Vácrátót, Alkomány u. 2-4.
HUNGARY
Phone: +36 28 360122/157
Fax..: +36 28 360110
[hidden email]
www.okologia.mta.hu

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Loading...