Re: [R-sig-eco] RE : CCA vs NMDS and ordisurf

2013-04-22 Thread Jari Oksanen
I also suggest (like I have suggested before) that you run metaMDS with 
argument plot = TRUE. The convergence criteria in metaMDS are pretty stringent, 
but with plot argument you can see how different the solutions are. Two most 
typical non-convergence cases are that 

(1) most points are stable, but there are a some outliers that don't find their 
place in this universe, and

(2) your data need more dimensions and you should increase 'k'.

Then you should also check the stressplot( ). If the fit line shoots right up 
at the maximum observed dissimilarity, you may need to turn on 'noshare' 
argument in metaMDS to trigger step across dissimilarities. We claim that this 
rarely necessary with the monoMDS engine we use currently, but sometimes it is 
needed.

Without hands on your data it is difficult to guess more.

Cheers, Jari Oksanen


Sent from my iPad

On 22.4.2013, at 22.31, "Gavin Simpson"  wrote:

> I would say that it *is* important, in general. However, you don't say
> if you retried running `monoMDS` on the Hellinger transformed data
> (without the Bray-Curtis metric - you should use Euclidean with
> Hellinger transformation)? If you didn't try rerunning with out
> Bray-Curtis and see if it converges. Otherwise, try many more iterations
> and get vegan to start monoMDS from the best solution from the first set
> of runs.
> 
> See `?metaMDS for details.
> 
> G
> 
> On Mon, 2013-04-22 at 08:26 +, Aurélie Boissezon wrote:
>> Hello everybody!
>> I didn't imagine that my questions will lead to such a debate among 
>> researchers :) . It helps me to get ready for future reviewers' comments.  ;)
>> Just a question still opened about NMDS (Gavin?):
>> Is it important to reach a convergent solution? since the "best" solution 
>> ordinate species always in similar way? Because as I said even with stricter 
>> criteria the analysis don't reach a convergent solution.
>> 
>> Best regards,
>> 
>> Aurélie
>> 
>> ---
>> Aurélie Rey-Boissezon
>> Ph-D Student
>> University of Geneva
>> Section of Earth and Environmental Sciences - Institute F.-A. Forel
>> Aquatic Ecology Group
>> Uni Rondeau
>> Site de Battelle - Bâtiment D
>> 7, route de Drize - 1227 Carouge
>> Geneva
>> Switzerland
>> Tel. 0041 (0) 22379 04 88
>> 
>> aurelie.boisse...@unige.ch
>> http://leba.unige.ch/team/aboissezon.html
>> 
>> De : fgill...@gmail.com [fgill...@gmail.com] de la part de François Gillet 
>> [francois.gil...@univ-fcomte.fr]
>> Date d'envoi : samedi 20 avril 2013 10:59
>> À : Gavin Simpson
>> Cc: Aurélie Boissezon; r-sig-ecology@r-project.org
>> Objet : Re: [R-sig-eco] RE : CCA vs NMDS and ordisurf
>> 
>> 
>> 2013/4/19 Gavin Simpson 
>> mailto:gavin.simp...@ucl.ac.uk>>
>> I really don't see why this has to be an either/or situation.
>> 
>> I fully agree: direct and indirect gradient analyses are complementary! 
>> Sorry for not having stressed that in my short answers...
>> 
>> François
>> 
> 
> -- 
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> Dr. Gavin Simpson [t] +44 (0)20 7679 0522
> ECRC, UCL Geography,  [f] +44 (0)20 7679 0565
> Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
> Gower Street, London  [w] http://www.ucl.ac.uk/~ucfagls/
> UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> 
> ___
> 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


Re: [R-sig-eco] extract distance from betadisp {vegan}

2013-04-22 Thread Mitchell, Kendra
Excellent, thank you.  I'm working with soil bacterial communities which have 
incredibly high diversity so insufficient sampling is often behind what 
initially looks like an interesting pattern.  If the increased dispersion in 
certain groups is related to some underlying ecology (such as response to 
disturbance), I'd expect little relationship between dispersion and alpha 
diversity.  But if the increased dispersion is just a byproduct of having only 
1500 observations of a community that is likely made up of 10^6 organisms, 
there will likely be a relationship.  at least that's my current hypothesis.


--
Kendra Maas Mitchell, Ph.D.
Post Doctoral Research Fellow
University of British Columbia


From: Gavin Simpson [gavin.simp...@ucl.ac.uk]
Sent: Monday, April 22, 2013 3:41 PM
To: Mitchell, Kendra
Cc: r-sig-ecology@r-project.org
Subject: Re: [R-sig-eco] extract distance from betadisp {vegan}

The distance to centroid for a site isn't a measure of that site's alpha
diversity. It is a reflection (an approximation) of the compositional
similarity of the sample to the other samples; distances between sites
reflect compositional dissimilarity.

The value you want are in the `$distances` component of the object
returned by `betadisper`.

I should add those as one of the options that `scores.betadisper`
extracts for you.

But I'm not convinced from what you write in your email that this
comparison is warranted nor that it will be fruitful nor enlightening.

HTH

G

On Mon, 2013-04-22 at 22:17 +, Mitchell, Kendra wrote:
> I've run betadisp on a set of communities and would now like to
> compare the distance for each sample from it's centroid to other
> measures such as alpha diversity.  Basically I want to check that
> increased dispersion isn't simply a reflection of overall diversity.
> It seems like I should be able to pull that out of the disp object but
> I haven't figured out how.  thanks
>
> Kendra
>
> --
> Kendra Maas Mitchell, Ph.D.
> Post Doctoral Research Fellow
> University of British Columbia
>
>   [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

--
Gavin Simpson, PhD  [t] +1 306 337 8863
Adjunct Professor, Department of Biology[f] +1 306 337 2410
Institute of Environmental Change & Society [e] gavin.simp...@uregina.ca
523 Research and Innovation Centre  [tw] @ucfagls
University of Regina
Regina, SK S4S 0A2, Canada




___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] extract distance from betadisp {vegan}

2013-04-22 Thread Gavin Simpson
The distance to centroid for a site isn't a measure of that site's alpha
diversity. It is a reflection (an approximation) of the compositional
similarity of the sample to the other samples; distances between sites
reflect compositional dissimilarity.

The value you want are in the `$distances` component of the object
returned by `betadisper`.

I should add those as one of the options that `scores.betadisper`
extracts for you.

But I'm not convinced from what you write in your email that this
comparison is warranted nor that it will be fruitful nor enlightening.

HTH

G

On Mon, 2013-04-22 at 22:17 +, Mitchell, Kendra wrote:
> I've run betadisp on a set of communities and would now like to
> compare the distance for each sample from it's centroid to other
> measures such as alpha diversity.  Basically I want to check that
> increased dispersion isn't simply a reflection of overall diversity.
> It seems like I should be able to pull that out of the disp object but
> I haven't figured out how.  thanks
> 
> Kendra
> 
> --
> Kendra Maas Mitchell, Ph.D.
> Post Doctoral Research Fellow
> University of British Columbia
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> 

-- 
Gavin Simpson, PhD  [t] +1 306 337 8863
Adjunct Professor, Department of Biology[f] +1 306 337 2410
Institute of Environmental Change & Society [e] gavin.simp...@uregina.ca
523 Research and Innovation Centre  [tw] @ucfagls
University of Regina
Regina, SK S4S 0A2, Canada

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] extract distance from betadisp {vegan}

2013-04-22 Thread Ricardo Solar
Hi Mitchell;

If I understood what you want, it should work:

beta <- betadisper(vegdist(matrix), type="centroid")
beta$distances

This will give you the raw values and then you can move with your analyses.
But check the new paper by Baselga 2013 Ecography before using
dissimilarity. He has interesting information.

==
Ricardo Ribeiro de Castro Solar (Curriculum
Vitœ
)
PhD Student - Entomology - Science Without Borders
Visit my blog!  / Rede
Amazônia Sustentável 
Mobile: +44 07956 126637 - Skype: rrsolar
UF Viçosa (Brazil) - Lancaster University (UK)
==


On 22 April 2013 23:17, Mitchell, Kendra  wrote:

> I've run betadisp on a set of communities and would now like to compare
> the distance for each sample from it's centroid to other measures such as
> alpha diversity.  Basically I want to check that increased dispersion isn't
> simply a reflection of overall diversity.  It seems like I should be able
> to pull that out of the disp object but I haven't figured out how.  thanks
>
> Kendra
>
> --
> Kendra Maas Mitchell, Ph.D.
> Post Doctoral Research Fellow
> University of British Columbia
>
> [[alternative HTML version deleted]]
>
> ___
> 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


[R-sig-eco] extract distance from betadisp {vegan}

2013-04-22 Thread Mitchell, Kendra
I've run betadisp on a set of communities and would now like to compare the 
distance for each sample from it's centroid to other measures such as alpha 
diversity.  Basically I want to check that increased dispersion isn't simply a 
reflection of overall diversity.  It seems like I should be able to pull that 
out of the disp object but I haven't figured out how.  thanks

Kendra

--
Kendra Maas Mitchell, Ph.D.
Post Doctoral Research Fellow
University of British Columbia

[[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] RE : CCA vs NMDS and ordisurf

2013-04-22 Thread Gavin Simpson
I would say that it *is* important, in general. However, you don't say
if you retried running `monoMDS` on the Hellinger transformed data
(without the Bray-Curtis metric - you should use Euclidean with
Hellinger transformation)? If you didn't try rerunning with out
Bray-Curtis and see if it converges. Otherwise, try many more iterations
and get vegan to start monoMDS from the best solution from the first set
of runs.

See `?metaMDS for details.

G

On Mon, 2013-04-22 at 08:26 +, Aurélie Boissezon wrote:
> Hello everybody!
> I didn't imagine that my questions will lead to such a debate among 
> researchers :) . It helps me to get ready for future reviewers' comments.  ;)
> Just a question still opened about NMDS (Gavin?):
> Is it important to reach a convergent solution? since the "best" solution 
> ordinate species always in similar way? Because as I said even with stricter 
> criteria the analysis don't reach a convergent solution.
> 
> Best regards,
> 
> Aurélie
> 
> ---
> Aurélie Rey-Boissezon
> Ph-D Student
> University of Geneva
> Section of Earth and Environmental Sciences - Institute F.-A. Forel
> Aquatic Ecology Group
> Uni Rondeau
> Site de Battelle - Bâtiment D
> 7, route de Drize - 1227 Carouge
> Geneva
> Switzerland
> Tel. 0041 (0) 22379 04 88
> 
> aurelie.boisse...@unige.ch
> http://leba.unige.ch/team/aboissezon.html
> 
> De : fgill...@gmail.com [fgill...@gmail.com] de la part de François Gillet 
> [francois.gil...@univ-fcomte.fr]
> Date d'envoi : samedi 20 avril 2013 10:59
> À : Gavin Simpson
> Cc: Aurélie Boissezon; r-sig-ecology@r-project.org
> Objet : Re: [R-sig-eco] RE : CCA vs NMDS and ordisurf
> 
> 
> 2013/4/19 Gavin Simpson 
> mailto:gavin.simp...@ucl.ac.uk>>
> I really don't see why this has to be an either/or situation.
> 
> I fully agree: direct and indirect gradient analyses are complementary! Sorry 
> for not having stressed that in my short answers...
> 
> François
> 

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London  [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Loop function or apply?

2013-04-22 Thread Roman Luštrik
How about something like this?

jonas <- data.frame(time = seq(100, 216000, by = 150), crobs = rnorm(1440))
head(jonas)

jonas$halfhour <- cut(jonas$time, breaks = seq(from = 0, to = 216000, by =
1800))
head(jonas)

tapply(jonas$crobs, INDEX = list(jonas$halfhour), FUN = mean)
# or
aggregate(crobs ~ halfhour, data = jonas, FUN = mean)
#or
by(data = jonas, INDICES = jonas$halfhour, FUN = function(x) mean(x$crobs))


Cheers,
Roman



On Mon, Apr 22, 2013 at 12:13 PM, Jonas Steenholdt Sørensen <
jonas.steenho...@gmail.com> wrote:

> > Hi everbody
> >
> > I'm working on my bachelor thesis on clearance rate for mussel and need
> some help R. First have a look at the DF
> >
> > TimeCRobs
> > 150  4.6589
> > 300  3.9685
> > 450  4.0124
> > ..   ...
> > 216000   1.0281
> >
> > These data is just made up, but is give some idea of the DF. I want to
> simplify my data and instead of having 144 rows of clearance rate, I want
> to look at the average within haft an hour. Like this:
> >
> > Time   avgCRobs
> > 1800 =average from 150-1800
> > 3600 =average from 1800-3600
> > .
> > 21600   =average from 19800-21600
> >
> > I have talk to one of my friend, that working mainly on C++ and he try
> with a loop function without any help and other of my college and friends
> from my studies couldn't help either. So I'm hoping there is one that could
> lead my on the right direction.
>
> ___
> 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.

[[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] Loop function or apply?

2013-04-22 Thread Jonas Steenholdt Sørensen
> Hi everbody
> 
> I'm working on my bachelor thesis on clearance rate for mussel and need some 
> help R. First have a look at the DF
> 
> TimeCRobs
> 150  4.6589
> 300  3.9685
> 450  4.0124
> ..   ...
> 216000   1.0281
> 
> These data is just made up, but is give some idea of the DF. I want to 
> simplify my data and instead of having 144 rows of clearance rate, I want to 
> look at the average within haft an hour. Like this:
> 
> Time   avgCRobs
> 1800 =average from 150-1800
> 3600 =average from 1800-3600
> .
> 21600   =average from 19800-21600
> 
> I have talk to one of my friend, that working mainly on C++ and he try with a 
> loop function without any help and other of my college and friends from my 
> studies couldn't help either. So I'm hoping there is one that could lead my 
> on the right direction.

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] RE : RE : CCA vs NMDS and ordisurf

2013-04-22 Thread Aurélie Boissezon
Hello everybody!
I didn't imagine that my questions will lead to such a debate among researchers 
:) . It helps me to get ready for future reviewers' comments.  ;)
Just a question still opened about NMDS (Gavin?):
Is it important to reach a convergent solution? since the "best" solution 
ordinate species always in similar way? Because as I said even with stricter 
criteria the analysis don't reach a convergent solution.

Best regards,

Aurélie

---
Aurélie Rey-Boissezon
Ph-D Student
University of Geneva
Section of Earth and Environmental Sciences - Institute F.-A. Forel
Aquatic Ecology Group
Uni Rondeau
Site de Battelle - Bâtiment D
7, route de Drize - 1227 Carouge
Geneva
Switzerland
Tel. 0041 (0) 22379 04 88

aurelie.boisse...@unige.ch
http://leba.unige.ch/team/aboissezon.html

De : fgill...@gmail.com [fgill...@gmail.com] de la part de François Gillet 
[francois.gil...@univ-fcomte.fr]
Date d'envoi : samedi 20 avril 2013 10:59
À : Gavin Simpson
Cc: Aurélie Boissezon; r-sig-ecology@r-project.org
Objet : Re: [R-sig-eco] RE : CCA vs NMDS and ordisurf


2013/4/19 Gavin Simpson 
mailto:gavin.simp...@ucl.ac.uk>>
I really don't see why this has to be an either/or situation.

I fully agree: direct and indirect gradient analyses are complementary! Sorry 
for not having stressed that in my short answers...

François


[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology