Re: [R-sig-eco] biplot with most important species
Hi Bjorn, I have done this in the past using ggplot2. I think that I plotted everything, but only labeled those that were above some threshold. In other words, I changed the label in the input data to "". I think that is how I solved this problem. HTH, Stephen On Wed, Oct 12, 2016 at 5:44 AM, Bjorn wrote: > Hi all, > > there might be a simple solution to do this, but I don't seem to manage to > find it. I have done a PCA using vegan. I now want to create a biplot with > only those species that explain a certain (cumulative) amount of the > variation along the first 2 PC axes (in order to keep things clear). How > could this be done? > > Thanks in advance! > > Kind regards, > > Bjorn > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] RLQ appropriate with factor variable in the R matrix?
Hello, I apologize this is more of a statistics question, but I am unsure where else to ask. Does it make sense to analyze data with L=abundances, Q=fuzzy coded traits, and R=Treatment (factor with 6 levels) with RLQ? many thanks, -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Regression with few observations per factor level
ote: > > > Hi, I would like to test the impact of a treatment of some variable > using regression (e.g. lm(var ~ trt + cov)). However I only have four > observations per factor level. Is it still possible to apply a regression > with such a small sample size. I think that i should be difficult to > correctly estimate variance.Do you think that I rather should compute a > non-parametric test such as Kruskal-Wallis? However I need to include > covariables in my models and I am not sure if basic non-parametric tests > are suitable for this. Thanks for any suggestion. > > > ___ > > > Mode, hifi, maison,… J'achète malin. Je compare les prix avec > > > [[alternative HTML version deleted]] > > > > > > ___ > > > R-sig-ecology mailing list > > > R-sig-ecology@r-project.org > > > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > > > > > > > > > > > -- > > > In God we trust, all others bring data. > > > > ___ > > Mode, hifi, maison,… J'achète malin. Je compare les prix avec > > [[alternative HTML version deleted]] > > > > _______ > > R-sig-ecology mailing list > > R-sig-ecology@r-project.org > > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > > > > > -- > > -- > Pokud je tento e-mail součástí obchodního jednání, Přírodovědecká fakulta > Univerzity Karlovy v Praze: > a) si vyhrazuje právo jednání kdykoliv ukončit a to i bez uvedení důvodu, > b) stanovuje, že smlouva musí mít písemnou formu, > c) vylučuje přijetí nabídky s dodatkem či odchylkou, > d) stanovuje, že smlouva je uzavřena teprve výslovným dosažením shody na > všech náležitostech smlouvy. > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] A beginner's question to constrained ordinations with vegan
Tim, I would take a look at Numerical Ecology with R. This book may not address your particular question, but should be useful as a general reference for using R for quantitative ecology. Some questions: Are you interested in what is structuring the community along an environmental gradient? What is the rational for investigating the sub-gradients? My own curiosity: Is there a literature source with quantitative data demonstrating that particular ordinations "better" uncover true environmental/distance relationships? A couple of comments (please correct my misunderstandings): RDA and PCA followed by envfit will give different results because they are doing very different things. From my understanding, rda uses the predicted value matrix from a multivariate regression of Comm_Mat ~ Env_Mat and then preforms a PCA on the resulting matrix (mean value given the environmental predictors; constrained). A PCA on the (appropriately hellinger transformed?) Comm_Mat is unconstrained by the environmental variation and projects sites along the direction of maximum variance in Comm_Mat only. Therefore, these techniques will give very different results. I hope that helps, and my explanation is not very far from the reality of the techniques. kindest regards, Stephen On 10/09/2014 07:26 AM, Tim Richter-Heitmann wrote: Hi there, i have a typical ecological problem (modelling abiotic parameters to bacterial abundances - i have 9 of these explanatory variables (but also a variety of spatial and biotic parameters, who may serve as explanators), many bacterial species and hundreds of sites). My species gradients seem to be very long in the DCA, so i began my analysis with CCA modelling all 9 abiotic parameters to the species matrix, and using the triplot as a final result. However, i have two very distinct bacterial communities in the DCA with a huge gap on the x-axis between them (one community is defining 90% of all samples, and the smaller one is found in 10% of the samples), so i was fiddling around with performing rda's (which i believe is recommended for small species gradients) on the two subsets. Now, a colleague was actually recommending me to use unconstrained ordinations like PCA and use envfit to fit the explanatory variables later. ord.OTU <- rda(OTU) ef <- envfit(ord.OTU, Env, perm=999) instead of ord.OTU <- rda(OTU~., Env) However, i fail to grasp the ideas and differences behind and between the two approaches - in my case, an envfitted PCA looked different than the "equivalent" RDA. As far as i have been taught, constrained ordination techniques like RDA or CCA search for the best explaining variables in the direct gradients, so i would use those for problems like mine per default. So, what are the benefits in using the unconstrained techniques first? Since i am new to the field, i lack the experience to evaluate this. Any advice would make me a very happy student. Thank you very much, and my apologies if i have asked something that was asked many times before. In fact, i tried to find the answer online, but wasnt too successful. -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] NA error in envfit
Kendra, Something is wrong in X or P; find out what the foreign function call is and then you may be able to track down the offending data problem. Maybe a logarithm somewhere? This is probably not much help; I don't have much experience with envfit. Stephen On 12/03/2013 07:06 PM, Mitchell, Kendra wrote: I'm running a bunch of NMS with vectors fitted (slicing and dicing a large dataset in different ways). I'm suddenly getting an error from envfit f.bSBS.org.fit<-envfit(f.bSBS.org.nms, f.bSBS.org.env, permutations=999, na.rm=TRUE) Error in vectorfit(X, P, permutations, strata, choices, w = w, ...) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: In vectorfit(X, P, permutations, strata, choices, w = w, ...) : NAs introduced by coercion I can plot the NMS and even run ordifit on individual env variables, so can't figure out what the problem is. There aren't any NA/NaN/Inf in either of those data that I can find. I've tried running it without na.rm=TRUE and still get the error. Guidance on how to fix this would be appreciated. Here's the whole slicing process and str for the data f.bSBS.org<-f.env$zone.hor=="bSBS.1" f.bSBS.org.tyc<-f.tyc[f.bSBS.org,f.bSBS.org] f.bSBS.org.env<-subset(f.env, f.env$zone.hor=="bSBS.1") f.bSBS.org.nms<-metaMDS(as.dist(f.bSBS.org.tyc), k=3, trymin=50, trymax=250, wascores=FALSE) f.bSBS.org.fit<-envfit(f.bSBS.org.nms, f.bSBS.org.env, permutations=999, na.rm=TRUE) str(f.bSBS.org.env) 'data.frame':63 obs. of 14 variables: $ zone : Factor w/ 6 levels "bIDF","bSBS",..: 2 2 2 2 2 2 2 2 2 2 ... $ site : Factor w/ 18 levels "A7","A8","A9",..: 12 12 12 12 12 12 12 12 12 12 ... $ om : Factor w/ 4 levels "0","1","2","3": 2 2 2 3 3 3 2 2 2 3 ... $ compaction : num 1 1 1 1 1 1 1 1 1 1 ... $ herbicide: num 0 0 0 0 0 0 0 0 0 0 ... $ horizon : Factor w/ 2 levels "1","2": 1 1 1 1 1 1 1 1 1 1 ... $ Water_content: num 50.3 50.3 50.3 50.1 50.1 ... $ DNA_ug_g : num 71.2 71.2 71.2 68.6 68.6 ... $ C: num 30.5 30.5 30.5 28.4 28.4 ... $ N: num 0.863 0.863 0.863 0.81 0.81 ... $ pH_H2O : num 4.63 4.63 4.63 4.49 4.49 ... $ CN : num 35.3 35.3 35.3 35.1 35.1 ... $ f.env$zone : Factor w/ 6 levels "bIDF","bSBS",..: 2 2 2 2 2 2 2 2 2 2 ... $ zone.hor : chr "bSBS.1" "bSBS.1" "bSBS.1" "bSBS.1" ... str(f.bSBS.org.nms) List of 35 $ nobj : int 63 $ nfix : int 0 $ ndim : num 3 $ ndis : int 1953 $ ngrp : int 1 $ diss : num [1:1953] 0.00424 0.00437 0.05169 0.07522 0.11039 ... $ iidx : int [1:1953] 12 8 55 56 52 7 56 12 59 52 ... $ jidx : int [1:1953] 7 6 18 55 8 3 18 3 12 49 ... $ xinit : num [1:189] 0.654 0.837 0.438 0.105 -0.313 ... $ istart: int 1 $ isform: int 1 $ ities : int 1 $ iregn : int 1 $ iscal : int 1 $ maxits: int 200 $ sratmx: num 1 $ strmin: num 1e-04 $ sfgrmn: num 1e-07 $ dist : num [1:1953] 0.0679 0.0231 0.3598 0.1248 0.1422 ... $ dhat : num [1:1953] 0.0455 0.0455 0.2076 0.2076 0.2076 ... $ points: num [1:63, 1:3] -0.1256 0.1224 0.267 0.2374 -0.0427 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : chr [1:63] "LL001" "LL002" "LL003" "LL007" ... .. ..$ : chr [1:3] "MDS1" "MDS2" "MDS3" ..- attr(*, "centre")= logi TRUE ..- attr(*, "pc")= logi TRUE ..- attr(*, "halfchange")= logi FALSE $ stress: num 0.157 $ grstress : num 0.157 $ iters : int 180 $ icause: int 3 $ call : language metaMDS(comm = as.dist(f.bSBS.org.tyc), k = 3, trymax = 250, wascores = FALSE, trymin = 50) $ model : chr "global" $ distmethod: chr "user supplied" $ distcall : chr "as.dist.default(m = f.bSBS.org.tyc)" $ distance : chr "user supplied" $ converged : logi TRUE $ tries : num 23 $ engine: chr "monoMDS" $ species : logi NA $ data : chr "as.dist(f.bSBS.org.tyc)" - attr(*, "class")= chr [1:2] "metaMDS" "monoMDS" -- Kendra Maas Mitchell, Ph.D. Post Doctoral Research Fellow University of British Columbia 604-822-5646 [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ***
Re: [R-sig-eco] forward selection RDA after controlling for constraints
Jari, Thank you for the quick reply. Maybe I should use something like PCNM first with the lat/long data to then use in the rda? I really appreciate all of your help. Are there anyother/better ways to account for spatial autocorrelation. I guess I need to show that spatial autocorellation exists and then if it does account for it? Any reading etc. would be greatly appreciated. I appreciate all of the help. kindest regards, Stephen P.S. I will let you know about the stepwise selection and scope argument On Wed, Jul 10, 2013 at 2:28 PM, Jari Oksanen wrote: > > On 10/07/2013, at 21:00 PM, Stephen Sefick wrote: > > > Hello all, > > > > I would like to run this by everyone and maybe get some hints as to what > R functions I could use for this. Ok, so I have macroinvertebrate > assemblage data from across the SE. I would like to control for geographic > distance (lat/long), Watershed area, and year before submitting these data > to an RDA with the rest of the environmental data using a variable > selection technique. > > > > Does it make sense to detrend the data using a mlm on hellinger > transfomed abundances with the above env variables as regressors and then > submit the residuals to rda with the rest of the env variables I am > interested in? > > > Stephen, > > If you happen to use vegan functions for forward selection, please note > that they all (should) take a scope argument that can (should) be a list of > lower and upper scopes. Put your controlled variables (distance???, > watershed area, year) in the lower scope and these plus other candidate > variables in the upper scope, and there you go. I have used "should", > because I have rarely used these functions myself, and I'm not sure if > lower scope really is implemented in all, but is *should* be: file a bug > report if this fails. > > I have no idea how to have distance RDA. Well, I have ideas, but none that > I have are very good. > > Using separate mlm and modelling residuals will not work quite correctly, > because that ignores correlations between groups of variables. Vegan > functions do not ignore those. > > Cheers, Jari Oksanen > -- > Jari Oksanen, Dept Biology, Univ Oulu, 90014 Finland > jari.oksa...@oulu.fi, Ph. +358 400 408593, http://cc.oulu.fi/~jarioksa > > > > > > [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] forward selection RDA after controlling for constraints
Hello all, I would like to run this by everyone and maybe get some hints as to what R functions I could use for this. Ok, so I have macroinvertebrate assemblage data from across the SE. I would like to control for geographic distance (lat/long), Watershed area, and year before submitting these data to an RDA with the rest of the environmental data using a variable selection technique. Does it make sense to detrend the data using a mlm on hellinger transfomed abundances with the above env variables as regressors and then submit the residuals to rda with the rest of the env variables I am interested in? Many thanks for all of the help. kindest regards, -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] pca or nmds (with which normalization and distance ) for abundance data ?
On Fri 14 Dec 2012 06:51:56 AM CST, Gavin Simpson wrote: On Fri, 2012-12-14 at 06:22 -0600, Stephen Sefick wrote: a) Which ordination method would be better for my data : PCA knowing that the represented inertia is 35.62% or NMDS with a stress value about 0.22? My opinion is PCA on hellinger transformed relative proportions "means" more than an NMDS ?? NMDS with Hellinger distances could optimise a k-D PCA with Hellinger transform. Gavin, maybe I have spoken beyond my knowledge. My though was that a PCA has a unique solution and is therefore "better" (as long as an appropriate distance is used that deals with the double zero problem effectively). I am sure that this is too simple for the reality of the situation. I don't know what a k-D PCA is. Would you mind explaining or directing me to some reading material? By k-D PCA I meant that in nMDS you need to state the dimensionality; in metaMDS() we start the process from a Principal Coordinates of the data (PCoA == PCA when Euclidean distances used). I meant that nMDS for say 2d solutions can optimise the configuration arising from the first two PCA axes. I don't see the unique solution of PCA as an implicit advantage of that method. It has a unique solution because the possible solutions are constrained by the approach; linear combinations of the variables which best approximate the Euclidean distances between samples. NMDS generalises this idea extensively into a problem of best preserving the mapping of the dissimilarities. As such it can do a better job of drawing the map but that comes at a price. Again though; horses for courses. Given that NMDS essentially subsumes PCA I'm not sure what you are getting at. I don't understand. Would you mind explaining this? many thanks, I meant in the sense that PCA is special case of Principal Coordinates and that nMDS generalises Principal coordinates. I don't get the point of saying one method is "better" than any other. Each has uses etc. I certainly don't think any one method "means" more than the other. Point taken. As always, it depends on the question that you are trying to answer. Thank you for the discussion and clarification. G Stephen G b) If NMDS is more adapted which one is the better? with Hellinger normalization and Bray-Curtis distance, or with the normalization recommended by Legendre and Legendre and Kulcynski distance ? I sounds like the normalization you are referring to is relative proportion which is si/sum(s); s is a vector of taxon at a site. c) Is there other method to apply? I’m going to try co-inertia with ade4 package I am reading about co-inertia analysis now as it may be useful for some of the things that I am planning on doing. This method looks promising. You are going to have to decide on what type of ordination to use with COIA... HTH, Stephen Thanks in advance. Cheers. Claire Della Vedova [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's n
Re: [R-sig-eco] pca or nmds (with which normalization and distance ) for abundance data ?
On Fri 14 Dec 2012 05:08:32 AM CST, Gavin Simpson wrote: On Thu, 2012-12-13 at 14:03 -0600, Stephen Sefick wrote: My aim was to study how the distribution of species is linked with environmental data. Firstly, I did a PCA (with vegan library), using a Hellinger transformation, with commands like this : acp1<-rda(decostand(myDataSpec[,c(25:62)], "hellinger")) Is the Hellinger transform done on relative proportions? The transformation includes division by by the row sum and hence conversion to proportions. As such it can be applied to count data or relative abundance data; with the latter the division by row sum will have no effect and then the transformation collapses to a simple square root transformation of the proportional abundance data. This is one of the reasons for the apparent contradictions over the utility of the chord distance in ecological and palaeoecological disciplines. In the latter we commonly use proportional data whilst count abundances are common in the former. Directly applying the chord distance to count abundances carries with it the baggage of the Euclidean distance (squared differences emphasise the big things). But chord distance applied to proportional data *is* the Hellinger distance and hence palaeoecologists have found the chord distance a useful dissimilarity coefficients in their field. a) Which ordination method would be better for my data : PCA knowing that the represented inertia is 35.62% or NMDS with a stress value about 0.22? My opinion is PCA on hellinger transformed relative proportions "means" more than an NMDS ?? NMDS with Hellinger distances could optimise a k-D PCA with Hellinger transform. Gavin, maybe I have spoken beyond my knowledge. My though was that a PCA has a unique solution and is therefore "better" (as long as an appropriate distance is used that deals with the double zero problem effectively). I am sure that this is too simple for the reality of the situation. I don't know what a k-D PCA is. Would you mind explaining or directing me to some reading material? Given that NMDS essentially subsumes PCA I'm not sure what you are getting at. I don't understand. Would you mind explaining this? many thanks, Stephen G b) If NMDS is more adapted which one is the better? with Hellinger normalization and Bray-Curtis distance, or with the normalization recommended by Legendre and Legendre and Kulcynski distance ? I sounds like the normalization you are referring to is relative proportion which is si/sum(s); s is a vector of taxon at a site. c) Is there other method to apply? I’m going to try co-inertia with ade4 package I am reading about co-inertia analysis now as it may be useful for some of the things that I am planning on doing. This method looks promising. You are going to have to decide on what type of ordination to use with COIA... HTH, Stephen Thanks in advance. Cheers. Claire Della Vedova [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel lik
Re: [R-sig-eco] pca or nmds (with which normalization and distance ) for abundance data ?
On Thu 13 Dec 2012 09:24:41 AM CST, claire della vedova wrote: Dear all, I’m a biostatistician working for a French institute involved in environmental risk assessment, and I would need help to understand the results I obtained from several ordination analyses. I have a dataset of 25 sites. For these 25 sites I have abundance data of 38 species and also the measurement of 5 environmental variables. Here an extract of my abundance data for the 5 first sites: Anguinidae.ditylenchus Aphelenchidae Aphelenchoididae Aporcelaimidae 12 18 184 0 0 14 154 0 45 0 101 6 20 0 148 0 0 0 118 0 Here the environmental data for the 5 first sites: ExtPond moist Corg pH DV50 0.946 9.086 4.269 5.24 171.33 0.682 27.139 23.813 3.82 75.45 2.480 14.322 7.191 4.48 230.90 3.069 18.380 11.404 3.58 211.19 2.615 16.693 7.128 4.12 224.45 My aim was to study how the distribution of species is linked with environmental data. Firstly, I did a PCA (with vegan library), using a Hellinger transformation, with commands like this : acp1<-rda(decostand(myDataSpec[,c(25:62)], "hellinger")) Is the Hellinger transform done on relative proportions? The first axe represent 19.5% the second one 16.3%. A colleague of me said it is not so bad with abundance data, but it seems to me quite poor. What do you think about ? You could use something like the broken stick model or others to access how many axes are necessary, but two axes explaining <40% of the variation seems low. Then, I fitted environmental vectors with the envfit function (of vegan library), with commands like this : physCInd.fit3<-envfit(acp1,MyDataEnv[,c(13,18,20,21,23)], permut=4999, na.rm=T) It appeared that pH variable is significantly linked with the ordination, and the pval of ExtPond is 0.1. Next I did a RDA which is not significant. To finish I did two NMDS. For the first one I used the Hellinger normalization and the Bray-Curtis distance. The stress obtained value is 0.22, Non metric fit R² is 0.952 and Linear fit R2 =0.777. When I fitted the environmental vectors , ExtPond was correlated with the ordination (pval =0.02) and p-val of pH = 0.23 But then I read in “numerical ecology” page 449 that it’s better to standardize the data by dividing each value by maximum abundance for species and then use Kulcynski distance. The stress value was 0.23 , Non metric fit R² was 0.948 and Linear fit R2 =0.69. These values are a little less good than those of the first NMDS, but the stressplot seems to me more homogenous. Nevertheless, the results I obtained are very different... When I fitted the environmental data it appeared that ExtPond was not correlated with this ordination (p-val=0.82) and p-val of pH=0.06. And obviously ExtPond is the most important variable for us ;-) With all these results, I’m quite confused, and I don’t know what to think. So, if someone can help me, I would appreciate it very much. Be sure that all comments will be welcome. To summarize my questions are : a) Which ordination method would be better for my data : PCA knowing that the represented inertia is 35.62% or NMDS with a stress value about 0.22? My opinion is PCA on hellinger transformed relative proportions "means" more than an NMDS b) If NMDS is more adapted which one is the better? with Hellinger normalization and Bray-Curtis distance, or with the normalization recommended by Legendre and Legendre and Kulcynski distance ? I sounds like the normalization you are referring to is relative proportion which is si/sum(s); s is a vector of taxon at a site. c) Is there other method to apply? I’m going to try co-inertia with ade4 package I am reading about co-inertia analysis now as it may be useful for some of the things that I am planning on doing. This method looks promising. You are going to have to decide on what type of ordination to use with COIA... HTH, Stephen Thanks in advance. Cheers. Claire Della Vedova [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman
Re: [R-sig-eco] Example on trend analysis for biological monitoring
I don't know of one specifically, but what are you trying to do? Stephen On 07/14/2012 10:05 AM, Manuel Spínola wrote: > Dear list members, > > Is there any simple example for teaching purposes on how to use R to > analyze a time series in a biological monitoring context? > > Best, > > Manuel > > > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] rarefaction not working with the min species number
Brian, What would you suggest? Is there any literature that you would suggest that I read? The abundances are estimated from a subsample of the whole sample using a volumetric procedure (subsamples out of 1L until at least 300 individuals are picked). This results in fractions of individuals for some, but not all taxa at a site. many thanks, Stephen On 04/25/2012 09:29 AM, Brian Inouye wrote: Although rounding to the nearest integer will make the code run without an error, it seems like then you are making the implicit assumption that every unit of abundance is an independent sample with equal probability of occurrence, equivalent to independent individuals. While I can imagine that is justifiable for some datasets, in other cases that would be a dubious assumption. -Brian On 4/25/2012 6:00 AM, r-sig-ecology-requ...@r-project.org wrote: From: Stephen Sefick To: Jari Oksanen Cc: r-sig-ecology Subject: Re: [R-sig-eco] rarefaction not working with the min species number Message-ID:<4f96b0b9.1050...@auburn.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Jari, Many thanks, that did the trick. Here is a little bit of code that took my non-integer data (abundance estimates), rounds, and turns the numbers into a data.frame with all integers col classes. community_round2int<- function(L){ ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] rarefaction not working with the min species number
Jari, Many thanks, that did the trick. Here is a little bit of code that took my non-integer data (abundance estimates), rounds, and turns the numbers into a data.frame with all integers col classes. community_round2int <- function(L){ row <- rownames(L) a <- as.data.frame(apply(L, 2, round)) b <- as.data.frame(apply(a, 2, as.integer)) rownames(b) <- row return(b) } kindest regards, Stephen On Tue 24 Apr 2012 08:01:16 AM CDT, Jari Oksanen wrote: On 24/04/2012, at 15:39 PM, Stephen Sefick wrote: I will provide reproducible code if I need to. All: I am trying to set up a 1000 pulls of a community data frame for calculating richness measures. I would like to be able to code the sample number based on the minimum of all of the samples. I can do this but there is an error: Error in sample(rep(nm, times = x[i, ]), sample[i]) : cannot take a sample larger than the population when 'replace = FALSE' when using: rrarefy(L, min(apply(L, 1, sum))) min is returning the lowest sample abundance of all of the samples. rrarefy works if I subtract 5 (arbitrary) from the min(...) statement. I am sure that I am missing something simple. many thanks, Stephen, I can reproduce this if input data ('L') contain non-integer data. The function is only able to handle integer data, but it does not check the input. Probably it should: the error would still be there, but the message would be more informative. Cheers, Jari -- Jari Oksanen, Dept Biology, Univ Oulu, 90014 Finland ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] rarefaction not working with the min species number
I will provide reproducible code if I need to. All: I am trying to set up a 1000 pulls of a community data frame for calculating richness measures. I would like to be able to code the sample number based on the minimum of all of the samples. I can do this but there is an error: Error in sample(rep(nm, times = x[i, ]), sample[i]) : cannot take a sample larger than the population when 'replace = FALSE' when using: rrarefy(L, min(apply(L, 1, sum))) min is returning the lowest sample abundance of all of the samples. rrarefy works if I subtract 5 (arbitrary) from the min(...) statement. I am sure that I am missing something simple. many thanks, -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Landscape ecology in R
Third hit in a google search for: landscape ecology R http://nricaribou.cc.umanitoba.ca/R/ On 03/09/2012 04:53 PM, Manuel Spínola wrote: > Dear list members, > > I am looking for any reference or material on landscape ecology analysis in > R. > > Thank you very much in advance. > > Best, > > Manuel > > > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] PCA
Is it an assemblage that you are trying to ordinate? If so, you can use the hellinger transformation that is avaliable in the decostand function of vegan to transform the data so that when you ordinate it you will then have euclidean distances. See Legendre and Gallagher 2001 for the relevant discussion. FWIW, Stephen On 03/03/2012 03:45 PM, Sami Rabei wrote: Dear All If I have a similarity matrix, It is possible to have a PCA (Principal component for it. Sami Rabei http://mansoura.academia.edu/SamiRabei -- With my Best Wishes Sami Hussein Rabei, Ph.D. Botany Department Faculty of Science at Damietta New Damietta , Post Box 34517 Damietta Egypt . Tel. Mobile: 002 0127 3601618 Tel. Work:002 057 2403981 Tel. Home:002 057 2403108 Fax: 002 057 2403868 ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Q10
linearize the model and fit. I think it is lny=lna+bx make sure I did the conversion correctly y=ae^bx take the natural log of both sides ln(y)=ln(ae^bx) ln(y)=a+ln(e^1)*bx ln(y)=a +bx Hopefully I did this right, Stephen On 01/30/2012 10:01 AM, Alan Haynes wrote: Dear Ecology list, I'm trying to calculate the Q10 (temperature sensitivity) of decomposition in R. I have done so in excel straight forwardly enough but I want to check it in R. Does anyone have any ideas how to go about this? It is calculated as y_T ~ a * e^(bx_T) where y is the decomposition rate at temperature T, x_T is the temperature and "a" and "b" are constants. "e" is the magic number (exp(1) ; 2.7183) then Q10 = exp(10*b) In excel I simply fit an exponential trend line, read off "b" from the formula and then calculate Q10 as above. In R it seems to be a bit harder. Ive attempted to use nls() to derive the exponent but I get a completely different number (when it doesnt give me a singularity error). nls() doesnt seem to like the "a" term either, as it seems to be this that generates the singularity issue. Does anyone know of a function, or suite of functions, for calculating Q10? Thanks in advance, Alan -- Email: aghay...@gmail.com Mobile: +41794385586 Skype: aghaynes [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Fwd: help
Mahnaz, We need this to be reproducible. Assuming you can get this into R, use dput and copy the results of that into an email. #copy this into R set.seed(1000) x <- data.frame(a=rnorm(10), b=rnorm(10), c=rnorm(10)) dput(x) #here is the output x <- (structure(list(a = c(-0.445778264836677, -1.2058565689643, 0.0411263138456899, 0.639388407571143, -0.786554355912735, -0.38548929809552, -0.475867884077706, 0.719750691474437, -0.018505622887574, -1.37311775893855), b = c(-0.982427827680338, -0.554488701581856, 0.121381188657659, -0.120872315937481, -1.33604104855461, 0.170057481208407, 0.155078715940733, 0.0249318673672384, -2.04658541402115, 0.213154105608615), c = c(2.67007166431368, -1.22701600631211, 0.834247331947683, 0.532571747050487, -0.646824963186768, 0.603161260832291, -1.78384413571217, 0.334942167117471, 0.560975721885086, 1.22093565459939 )), .Names = c("a", "b", "c"), row.names = c(NA, -10L), class = "data.frame")) notice that I have wrapped the output in x <-() to make it copy and paste ready. Now we have something to work with. If you can't get data into R then that is a different question. Stephen Sefick On 12/10/2011 12:57 PM, Mahnaz Rabbaniha wrote: -- Forwarded message -- From: Mahnaz Rabbaniha Date: Sat, 10 Dec 2011 08:31:10 +0330 Subject: Re: [R-sig-eco] help To: Sarah Goslee Dear Sarah thank you for your attention, I want to use PCA with supplementary variables due to correlation between the independent factor such as salinity ,temperature... with dependent variable ( fish larva ) therefore changed dependent variable with log(x+1) and tested normality with shapiro test but data haven't changed and remained non normality then i decided to used the nonparametric analysis MDS and found its order from net but it wasn't successfully and plot of matrix was empty. my question is: for using the MDS have to need the special form of excel , thanks mahnaz On 12/9/11, Sarah Goslee wrote: Hi, On Fri, Dec 9, 2011 at 7:13 AM, Mahnaz Rabbaniha wrote: Hi in my project i collected its data in excel sheet that i attached,data were non normal then i transformed them and check the normality by shapiro.test that it showed again non-normality therefore i decided used the MDS analyses in r and download this site ( http://www.statmethods.net/advstats/mds.html) but i haven't done it, i think the main problem is the form of excel matrix for doing it and also i want to know about different between CLASSICAL MDS and isoMDS. We need to know more about what you're donig to be able to help with the excel matrix. What is the problem? How are you importing it into R? ?cmdscale library(MASS) ?isoMDS offers some information about the algorithms used in the two approaches, as well as many references for more information Briefly and simplistically, the difference has to do with whether the algorithm attempts to preserve actual dissimilarities or rank-order dissimilarities. please help me because this method is new in iran Thanks in advance -- *Mahnaz Rabbaniha* *Senior expert of marine ecology * *Iranian Fisheries Research Organization (IFRO) * *P.O.Box: 14155-6116 , P.Code: 1411816618* Tehran, IRAN Phone: +98 21 44580953 *Fax: +98 21 44580583* *Mobile: +98 912 5790377* *Website: http://www.ifro.ir* -- Sarah Goslee http://www.functionaldiversity.org ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Stephen Sefick ** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama 36849 ** sas0...@auburn.edu http://www.auburn.edu/~sas0025 ** Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] NMDS vegan
highlight all of the cells in the data matrix and in the edit menu (?) you should find "find and replace". HTH, Stephen On Tue, Oct 26, 2010 at 1:30 PM, Soumi Ray wrote: > Hi all, > It worked when I replaced the blanks (missing) in my spreadsheet as NA and > saved it as csv. > Stephen, my data is in excel spreadsheet, I have no clue how to replace all > the blank cells in the huge dataset as NA. > > Thank for the help. > > Soumi > > On Mon, Oct 25, 2010 at 2:10 PM, Soumi Ray wrote: > >> Hi listers, >> >> I am trying to run NMDS in vegan package. I have a species dataset - with >> columns as species and rows as variables. All my data are 0/1 >> (presence/absence). My data has missing values. I saved my data in txt file >> and the missing values are blank spaces. I am using the syntax: >> > > >> But it is showing me the error: >> Error in distfun(comm, method = distance, ...) : >> NA/NaN/Inf in foreign function call (arg 1) >> In addition: Warning message: >> In distfun(comm, method = distance, ...) : >> you have empty rows: their dissimilarities may be meaningless in method >> bray >> >> Could anyone kindly let me know where am I going wrong? I admit i am new to >> R, trying to self tutor myself. >> >> Thank you, >> >> Regards, >> >> Soumi >> > > [[alternative HTML version deleted]] > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Stephen Sefick | Auburn University | | Department of Biological Sciences | | 331 Funchess Hall | | Auburn, Alabama | | 36849 | |___| | sas0...@auburn.edu | | http://www.auburn.edu/~sas0025 | |___| Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." -Robert Gentleman ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] Species Area Curve (recreating EstimateS output)
I would like some advice on the "appropriate" method for constructing species area curves. I have written a function based on the vegan function specaccum, which I will include later in the email. I would like to fit the michalis-menton equation to the data to extrapolate to more area than we have sampled. When should I fit the nls model? I am more or less trying to duplicate functionality of EstimateS, trying to carry out my advisors wishes, and above all trying to accurately assess the area needed to sample effectively the benthic diversity in coastal plain streams of the Southeastern United States. take 100 permutations of the species accumulation (randomly sample the stations and build the accumulation from this) then: 1.take the mean of the permuted accumulation data and fit the model 2.fit the model to all of the permutations separately and then take the mean of the predicted 3.fit the model to all of the permuted data together Thanks very much for any and all help Stephen function for 2 above: #feed regular vegan community matrix into this... perm_species <- function(comm, sites=6, permutations=1000, predict=100, surber_num=3, surber_size=0.092){ surber_station <- surber_num*surber_size x <- comm x <- as.matrix(x) x <- x[, colSums(x) > 0, drop=FALSE] n <- nrow(x) p <- ncol(x) if (p == 1) { x <- t(x) n <- nrow(x) p <- ncol(x) } accumulator <- function(x, ind) { rowSums(apply(x[ind, ], 2, cumsum) > 0) } perm <- array(dim = c(n, permutations)) for (i in 1:permutations) { perm[, i] <- accumulator(x, sample(n)) } nls.fit <- array(dim = c(predict, permutations)) predict2 <- seq(from=surber_station, by=surber_station, length.out=predict) for(i in 1:permutations){ sites2 <- 1:sites square_meters <- seq(from=surber_station, by=surber_station ,length.out=sites) s <- data.frame(x=square_meters, y=perm[,i]) #o <- nls(y~a*(x^b), start=list(a=10, b=1), data=s) o <- nls(y~((a*x)/(b+x)), start=list(a=10, b=1), data=s) nls.fit[,i] <- (coef(o)["a"]*predict2)/(coef(o)["b"]+predict2) } sites <- 1:n specaccum <- apply(nls.fit, 1, mean) sdaccum <- apply(nls.fit, 1, sd) error <- qnorm(0.975)*sdaccum/sqrt(permutations) left <- specaccum-error right <- specaccum+error out <- data.frame(specaccum, sdaccum, left, right) out } -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] deleted from mailing list
I suspect you need to unsubscribe. On Tue, Apr 20, 2010 at 12:22 PM, wrote: > > Hi, > > please deleted my email from mailinglist > > thanks for all > > m. > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] About Vegan
You can change the labels of the axis with breaks I believe. The plot function with vegan works like the base plot. Also, look at the ?ordiplot. A reproducible example would help. On Wed, Apr 8, 2009 at 4:50 AM, mujeeb rahman wrote: > Hi All > I have a small doubt on biplots. How we can change the scale of biplot > display. In my figure, scale is 0, 200, 400, 600. But I want to adjust > the scale 0, 10, 20 and so on. Expecting the valuable reply > Mujeeb Rahman P > Kerala Forest Research Institute > Kerala, India > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Phase spectrum
lag.plot2=function(data1,data2,max.lag=0,corr=TRUE,smooth=FALSE){ name1=paste(deparse(substitute(data1)),"(t-",sep="") name2=paste(deparse(substitute(data2)),"(t)",sep="") data1=as.ts(data1) data2=as.ts(data2) max.lag=as.integer(max.lag) m1=max.lag+1 prow=ceiling(sqrt(m1)) pcol=ceiling(m1/prow) a=ccf(data1,data2,max.lag,plot=FALSE)$acf par(mfrow=c(prow,pcol), mar=c(2.5, 4, 2.5, 1), cex.main=1.1, font.main=1) for(h in 0:max.lag){ plot(lag(data1,-h), data2, xy.labels=F, main=paste(name1,h,")",sep=""), ylab=name2, xlab="") if (smooth==TRUE) lines(lowess(ts.intersect(lag(data1,-h),data2)[,1], ts.intersect(lag(data1,-h),data2)[,2]), col="red") if (corr==TRUE) legend("topright", legend=round(a[m1-h], digits=2), text.col ="blue", bg="white", x.intersp=0) } } I believe that it is neither library(zoo) plot(coredata(mdeaths)~coredata(fdeaths)) But I am still learning about timeseries analysis. Stephen Sefick On Thu, Mar 19, 2009 at 6:04 PM, Gunnar Hoyer wrote: > Hello, > > I have trouble to interpret the phase spectrum correctly. > > Here is the code (with different data) I used to get the phase spectrum: > > mfdeaths.spc <- spec.pgram(ts.union(mdeaths, fdeaths), spans = c(3,3)) > plot(mfdeaths.spc, plot.type = "phase") > > I would like to know whether positive or negative values indicate that the > time series mdeaths leads or lags. > > Thanks in advance > Gunnar Hoyer > > _______ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] backcalculation of HIV infection rates
It seems like that would not be that hard, but it is not in my area. My advice is to break the problem up, write code for each sub-problem, and then combine all of the little functions into one big function to "solve" the problem. my two cents, Stephen Sefick On Thu, Mar 19, 2009 at 8:21 AM, Gladys Dimba wrote: > The backcalculation is a procedure that has been used to calculate the HIV > incidence given AIDS diagnosis cases (usually annual cases or quarterly > cases) and some assumed incubation period distribution : usually the Weibull > or gama has been used. > > How can the backcalculation be implemented in R? > > [[alternative HTML version deleted]] > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Intepreting a plot from a "constrained" NMDS
A way that may work is use the axis scores as y in a regression- this seems like it would let you interpret how the communities are distributed in species space. Just a thought Stephen Sefick On Sat, Dec 6, 2008 at 11:58 AM, Manuel Spínola <[EMAIL PROTECTED]> wrote: > Dear list members, > > Is there any reference or document on how to interpret a "constrained" > non-metrical multidimensional scaling using ecological data? By > "constrained" I mean after fitting environmental covariables, using, for > example, the "envfit" function in the vegan package. Is it possible to > interpret the resulting plot in the same way that a constrained ordination, > for example CCA? > Thank you very much in advance. > Best, > > Manuel > > -- > Manuel Spínola, Ph.D. > Instituto Internacional en Conservación y Manejo de Vida Silvestre > Universidad Nacional > Apartado 1350-3000 > Heredia > COSTA RICA > [EMAIL PROTECTED] > [EMAIL PROTECTED] > Teléfono: (506) 2277-3598 > Fax: (506) 2237-7036 > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] StreamMetabolism 0.03 Released
StreamMetabolism 0.03 was uploaded onto CRAN this evening and should be available soon. Function sunrise.set has been added which is highly reliant on map tools sunriset function. This function makes it easy to create a sequence of sunrise sunset times. EcosystemProduction.20 has been added to account for temperature's effect on respiration (reaction rate doubling for every 10 deg. C). The correction is preformed in the daytime and not during the night. The rational here is that the average nighttime rate is an actual average (assuming that only respiration is acting at night). During the day the actual respiration rate can not be measured, but the effect of temperature on chemical reaction rate is known and the following equation is used. ERt = ERa*(1.072^(T-Ta)) ERt = Ecosystem Respiration @ Temp ERa = Average Nighttime Respiration T = Temperature @ which to predict ER Ta = Average Nighttime Temperature As always comments, questions, and suggestions are welcome. regards, -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Academic assistance
we need your data set up- read fake data with the problem built in... Although my first guess would be that (3) one variable is a factor... str(your.data.frame) and see. This may or may not solve all of your problems. Stephen On Fri, Nov 7, 2008 at 10:45 AM, Christian A. Parker <[EMAIL PROTECTED]> wrote: > HolyI, > > To get help with something like this it is best to include the code along > with a short description of what you are trying to do. Without that we are > just guessing. > > -Chris > > HolyI N.M wrote: >> >> Greetings to all R Helpers out there. >> Please, I am new to this software.In attempt to analyse my data(here >> attached) I had the following problems: >> 1. spp richness could be calculated on seperate plots not on all.However, >> accumulation curve could be obtained; >> 2. No diversity index can be calculated >> 3. PCA, CCA, clustering, spatial distribution of spp. wrt environmental >> variables, spp. abundance, etc could not be calculated; >> The complain I got which I could not solve was, "Warning:1 variables of >> the community dataset (out of a total of 367) are factors". >> Please, someone should kindly help me to correct this so I can finish my >> work on time. >> Thanks for your time. >> >> Innocent Ndoh Mbue >> Institute of Ecocolgy and >> Environmental Sciences >> s/c >> International corporation office >> China University of Geosciences >> 388 lumo road; 430074, Wuhan >> Phone:0086 027 67885947/0086 13419615739 >> [EMAIL PROTECTED] Alt [EMAIL PROTECTED] S.Q: meet her My Ans.:im >> schule >> >> >> >> >> >> >> ___ >> R-sig-ecology mailing list >> R-sig-ecology@r-project.org >> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Ecology and Stats
I am subscribed to both. Double posting is discouraged; however, I have indeed posted to both: if I don't get a response on the ecology forum for a ecology specific question I try and generalize the question for the R-help forum at large and then post there. I don't know if this is proper, but i have not been reprimanded extensively. On Wed, Oct 8, 2008 at 10:07 AM, Darin Brooks <[EMAIL PROTECTED]> wrote: > Quick question: > > Is it considered bad manners to post a question on the r-help forum and > then > re-post the same question on the r-sig-ecology forum? Are they considered > the "same" by R advise givers? Double posting is discouraged in most user > forums. Do users typically subscribe to both (or more than one) of the R > forums? > > > > Darin Brooks > Geomatics/GIS/Remote Sensing Coordinator > Kim Forest Management Ltd. Cranbrook Office > Cranbrook, BC > www.kfm.ca <http://www.kfm.ca/> > > > >[[alternative HTML version deleted]] > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] StreamMetabolism
StreamMetabolism has just been released on CRAN. It is a package for the calculation of stream metabolism based on the single station method from diurnal oxygen curves. It will probably undergo significant upgrades as the need arises. I would greatly appreciate Comments, Suggestions, and help in improving upon this package. Enjoy Stephen Sefick -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Question about Multivariate Time Series Analysis
vegan and look at the ecological task view On Tue, Jul 22, 2008 at 12:28 PM, Patricia Rodríguez González < [EMAIL PROTECTED]> wrote: > Dear colleagues > > I wanted to analyse the variation of floristic > composition on time. I have sampled 3 forests > monthly during a year with 4 plots in each. I > have environmental variables also monthly > measured and I would like to determine with env > variables have more contribution for the monthly > variation of the floristic composition during the year. > This would be like CCA along time (?) I would > like to know if there is any package to do this. > > Thanks > > Patricia Rodríguez González > Departamento de Engenharia Florestal > Instituto Superior de Agronomia > Tapada da Ajuda 1349-017 > Lisboa, Portugal >[[alternative HTML version deleted]] > > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > > -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] stream metabolism
I was wondering if anyone had written software for calculating stream metabolism before I give her a whirl. The upstream downstream method (Odum) and the single station method (I don't remember the reference). I have fifteen minute DO data and associated travel times. This would be my first real programming effort and any and all help would be appreciated. thanks Stephen -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Migrate R-sig-ecology to Nabble2?
I didn't know that there was a Nabble2. I also didn't realize that the ecology list was already on Nabble1. Sorry for the confusion- I searched on Nabble1 just fine. What is Nabble2? Stephen On Wed, Jun 18, 2008 at 8:48 AM, <[EMAIL PROTECTED]> wrote: > > All, > > Sorry for the delay in responding, I have been away. > > As some have already mentioned, R-sig-ecology is already on Nabble. I > will look into getting it migrated to Nabble2. > > Also, the list is also included on Gmane (http://gmane.org) for those > that prefer that inteface. > > Thanks for the suggestion! > > Cheers, > Jeff > > *** > Dr. Jeffrey W. Hollister > US EPA > Atlantic Ecology Division > 27 Tarzwell Drive > Narragansett, RI 02882 > (401) 782-9655 > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Migrate R-sig-ecology to Nabble2?
I find Nabble a very helpful search tool- I would love to be able to use it to search this list also. just my two cents Stephen On Tue, Jun 17, 2008 at 1:52 PM, David Hewitt <[EMAIL PROTECTED]> wrote: > > For other lists that I archive at Nabble, I just posted a thread at the > Nabble Support forum and they handled it. Easy. > > > > > Thanks for bringing this to our attention. Neither of us use Nabble, and > I > > at least know absolutely nothing about it. We'll look into it. > > > > On Tue, Jun 17, 2008 at 12:20 PM, David Hewitt <[EMAIL PROTECTED]> > > wrote: > >> > >> Has anyone initiated the migration of the R-sig-ecology list to Nabble2? > >> > >> See http://n2.nabble.com/nabble2.html > > > > > - > David Hewitt > Research Fishery Biologist > USGS Klamath Falls Field Station (USA) > -- > View this message in context: > http://www.nabble.com/Migrate-R-sig-ecology-to-Nabble2--tp17916977p17927711.html > Sent from the r-sig-ecology mailing list archive at Nabble.com. > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] wavCWT output to an interactive rgl device
I am wondering if there is a way to get the perspective plot of a wavCWT object to be used in an rgl device. I think that you can extract the time and scale part of the object but what about the modulus/amplitude part of the wavelet transform? I would like to use plot3d or something like this to get an interactive plot. thanks Stephen -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] wavCWT (wmtsa) iterations?
I have hit the max memory for my poor little computer. I there a way to just section the sections that I would like to look at instead of doing the transform on the whole dataset? scale.range only works when I specify deltat(x.ts). It would be nice to start this at say a day to a week. my data is in 15min. intervals so this could correspond to 96 to 672 readings. The other thing that I was wondering if I could do is do this on subsets of the data and then combine them into one big plot for the CWT of the entire data set- iterate through "chunks" and then combine them at the end? thanks Error: cannot allocate vector of size 98.2 Mb In addition: Warning messages: 1: In wavCWT(x.ts) : Reached total allocation of 502Mb: see help(memory.size) 2: In wavCWT(x.ts) : Reached total allocation of 502Mb: see help(memory.size) 3: In wavCWT(x.ts) : Reached total allocation of 502Mb: see help(memory.size) 4: In wavCWT(x.ts) : Reached total allocation of 502Mb: see help(memory.size) -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] wmtsa
I would like to change the wavCWT (package wmtsa) plot colors does anyone know how to do this. d = wavCWT(x)# I can provide data but it is a rather large data set plot(d) #default color scheme does not have enough contrast thanks Stephen -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] beam forming
This is a geophysics trick for finding peaks in a signal that are seperated by distance- does anyone know of an R routine for preforming this? -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] script editor
Aquamacs I just downloaded for a Mac OS X Emacs and it looks and works pretty well. I don't know anything about Emacs, but I am starting to write code so this looks pretty promising. On Wed, Apr 23, 2008 at 1:08 PM, Jarrett Byrnes <[EMAIL PROTECTED]> wrote: > So, so far it seems like we have lots of votes for Tinn-R, a few for > Emacs, and for those on linux, Rkward looks pretty rocking. > > For those of us on OSX who are using the mac interface (I'm assuming > emacs won't pipe to it) are there other good editors out there beyond > the one that comes with R.app > > Oh, and a quick note that I found buried in some documentation rather > than an intuitive place: The R.app editor does allow you to pipe > selected code to the console. Highlight it, and hit apple-enter. > > -Jarrett > > > > > > --- > To call in the statistician after the experiment is done may be no > more than asking him to perform a post-mortem examination: he may be > able to say what the experiment died of. > > Sir Ronald Aylmer Fisher > > ___ > R-sig-ecology mailing list > R-sig-ecology@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology > -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology