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 <[email protected]> de la part de [email protected] <[email protected]> Envoyé : lundi 30 mai 2016 12:00 À : [email protected] Objet : R-sig-ecology Digest, Vol 98, Issue 15 Send R-sig-ecology mailing list submissions to [email protected] 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 [email protected] You can reach the person managing the list at [email protected] 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 <[email protected]> To: [email protected] Subject: [R-sig-eco] rarefy function in vegan, exporting to spreadsheet Message-ID: <cak2sg-0m2v4izvvkalhre+2a_qdrjcae-v0rwwqtcy5rbsl...@mail.gmail.com> 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 [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-ecology ------------------------------ End of R-sig-ecology Digest, Vol 98, Issue 15 _______________________________________________ R-sig-ecology mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
