[R-sig-eco] slope for rarefaction curve

2015-05-10 Thread Simone Ruzza
Dear all,

apologies for the total beginner's question. I was wondering if anyone
can give some advice on how to calculate the slope for the last 10% of
the records of a rarefaction curve computed with rarefy from vegan.
Here is a graphic representation of what I would like to do:

https://dl.dropboxusercontent.com/u/33966347/figure.JPG

I have seen that this has been done in a recent paper and I was
wondering if anyone may have any code snippet to do that. Sorry, maybe
this is something really obvious but I have not quite understood how
to do it.

thanks!

Simone

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


[R-sig-eco] simple question about CCA

2014-09-11 Thread Simone Ruzza
Dear all,

apologies for the simplicity of my question, maybe it has been asked
many times, but I am a total novice to CCA. I have performed a CCA
using a series of environmental variables that comprise a mixture of
categorical and non-categorical variables. What I do not understand is
why when I change the order of my variables and I plot the results, a
variable disappears from the CCA biplot i.e. the last one being
continuous variable. I realised that there might a very simple
question, so I would be happy even with a reference where to find an
answer. Below some code showing what is happening.

thanks in advance,

Simone



require(RCurl)
require(vegan)
x <- getURL("https://dl.dropboxusercontent.com/u/33966347/testdata.csv";)
dat<- read.csv(text = x)


# example 1 x7 disappear from the plot (note that x5 and x6 are categorical)
ccatest<-cca(dat[8:144]~x1+x2+x3+x4+x5+x6+x7,data=dat)
plot(ccatest)

# example 2 x7 is present in the plot
ccatest1<-cca(dat[8:144]~x7+x1+x2+x3+x4+x5+x6,data=dat)
plot(ccatest1)

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


[R-sig-eco] issue with dbFD function from FD library

2014-08-04 Thread Simone Ruzza
Dear R-users,

apologies for the total beginner's question. I am trying to calculate
three metrics of functional
diversity using the dbFD function from the FD package, but everything
seems to crash, shortly
after I start the analysis. I am using presence and absence data and a
mixture of categorical and continuous traits. I have pasted the error
message which I get from the R console at the bottom of this e-mail,
together with four lines of code and url to files used for the
analysis. I understand that the issue might be with qhull and not the
dbFD function, but I would like to try and understand why things are
not working. A lot of my communities  have few species ( < 3), but not
all of them. I understand that dbFD cannot compute any measures with
communities less than three species, but should the function at least
compute for communities with more than 3 species? Is that because
there are less species (not always) than traits? Any help would be
greatly appreciated!

Best wishes,

Simone


 code
library(FD)
sp<-read.csv("spdata.csv")
traits<-read.csv("traits.csv",row.names=1)
fd<-dbFD(x=traits,a=sp,corr="sqrt",calc.FDiv=FALSE,calc.FGR=FALSE,calc.CWM=FALSE)

 dropbox link to files

# species
https://dl.dropboxusercontent.com/u/33966347/spdata.csv
# traits
https://dl.dropboxusercontent.com/u/33966347/traits.csv


### error message

qhull precision warning:
The initial hull is narrow (cosine of min. angle is 1.).
Is the input lower dimensional (e.g., on a plane in 3-d)?  Qhull may
produce a wide facet.  Options 'QbB' (scale to unit box) or 'Qbb' (scale
last coordinate) may remove this warning.  Use 'Pp' to skip this warning.
See 'Limitations' in qh-impre.htm.
QH6114 qhull precision error: initial simplex is not convex. Distance=-4.2e-17

While executing:  | qhull FA Qt
Options selected for Qhull 2012.1 2012/01/26:
  run-id 2058602770  FArea-total  Qtriangulate  _pre-merge  _zero-centrum
  _max-width 0.34  Error-roundoff 2e-16  _one-merge 1e-15  _near-inside 5.1e-15
  Visible-distance 4.1e-16  U-coplanar-distance 4.1e-16  Width-outside 8.2e-16
  _wide-facet 2.5e-15  _narrow-hull  0

precision problems (corrected unless 'Q0' or an error)
  1 flipped facets

The input to qhull appears to be less than 2 dimensional, or a
computation has overflowed.

Qhull could not construct a clearly convex simplex from points:
- p1(v2):   0.1 -0.11
- p0(v1):   0.1 -0.11
- p2(v0): -0.24  0.14

The center point is coplanar with a facet, or a vertex is coplanar
with a neighboring facet.  The maximum round off error for
computing distances is 2e-16.  The center point, facets and distances
to the center point are as follows:

center point -0.01213 -0.02829

facet p0 p2 distance= -2.4e-17
facet p1 p2 distance= -1.7e-17
facet p1 p0 distance= -0.084

These points either have a maximum or minimum x-coordinate, or
they maximize the determinant for k coordinates.  Trial points
are first selected from points that maximize a coordinate.

The min and max coordinates for each dimension are:
  0:   -0.23870.1011  difference= 0.3398
  1:   -0.11260.1404  difference= 0.253

If the input should be full dimensional, you have several options that
may determine an initial simplex:
  - use 'QJ'  to joggle the input and make it full dimensional
  - use 'QbB' to scale the points to the unit cube
  - use 'QR0' to randomly rotate the input for different maximum points
  - use 'Qs'  to search all points for the initial simplex
  - use 'En'  to specify a maximum roundoff error less than 2e-16.
  - trace execution with 'T3' to see the determinant for each point.

If the input is lower dimensional:
  - use 'QJ' to joggle the input and make it full dimensional
  - use 'Qbk:0Bk:0' to delete coordinate k from the input.  You should
pick the coordinate with the least range.  The hull will have the
correct topology.
  - determine the flat containing the points, rotate the points
into a coordinate plane, and delete the other coordinates.
  - add one or more points to make the input full dimensional.
Error in convhulln(tr.FRic, "FA") : Received error code 2 from qhull.

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


Re: [R-sig-eco] simple question about nmds

2013-06-10 Thread Simone Ruzza
Apolologies, I re-phrase what I have said before: I would be interested
using the site scores within a multiple regression settings, but the the
scores a response rather than predictors.

Best wishes,

Simone


On Mon, Jun 10, 2013 at 9:19 AM, Simone Ruzza wrote:

> Dear list,
>
> apologies for the total beginner's question. I was wondering whether
> one can use the site scores of an NMDS ordination to do do further
> analyses as typically done for other ordination methods, e.g. use the
> axis scores as predictors in a multiple regression settings. I think
> it should not be possible, because the aim of NMDS is not to summarize
> the major patterns of variations withing a multivariate dataset. Do
> you confirm?
>
> thanks in advance,
>
> Simone
>

[[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] simple question about nmds

2013-06-10 Thread Simone Ruzza
Dear list,

apologies for the total beginner's question. I was wondering whether
one can use the site scores of an NMDS ordination to do do further
analyses as typically done for other ordination methods, e.g. use the
axis scores as predictors in a multiple regression settings. I think
it should not be possible, because the aim of NMDS is not to summarize
the major patterns of variations withing a multivariate dataset. Do
you confirm?

thanks in advance,

Simone

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


[R-sig-eco] question about MuMIn package

2013-01-22 Thread Simone Ruzza
Dear R users,

I would like to use the MuMIn package to perform model average on a
simple GLM containing a mixture of categorical and continuous
predictors. The model.avg functions seems to work with models
containing continuous and categorical variables, but I am wondering
whether somebody could tell me if the relative importance obtained for
categorical predictors (i.e. the selection probability) is meaningful
when using this function?

thanks in advance,

Simone

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