Re: [R-sig-eco] readOGR and Multiple incompatible geometries in rgdal

2015-01-20 Thread Ivailo
On Tue, Jan 20, 2015 at 3:05 PM, Patrick Giraudoux
patrick.giraud...@univ-fcomte.fr wrote:
 Dear all,

 I have to cope with a MapInfo file  (.TAB and associated files) with
 obviously muliple geometries in (e.g. points and lines) and readOGR
 (package: rgdal). When reading, I get the following error message:

 readOGR(.,PacoursIKA)
 Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = 
 use_iconv,  :
Multiple incompatible geometries: wkbPoint:wkbLineString

 Of course, the cause is obvious and I can manage reading the file from
 e.g. QGIS (a dialog box permits to select one of the two geometries) and
 then export to a single geometry shapefile. The latter can be read from
 R using readOGR.

 However, I would like to know if there is a work around within rgdal (eg
 an extra argument in readOGR) that could make the job done within an R
 environment. The workhorse in QGIS is gdal as in rgdal, so suppose
 something may be possible.

 Best,

 Patrick

Patrick,

I don't know the answer to your question but if you post it on the
R-sig-Geo list (https://stat.ethz.ch/mailman/listinfo/r-sig-geo) you
might get a satisfying answer faster.

Cheers,
Ivailo

___
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 residuals from adonis function in vegan package

2014-03-18 Thread Ivailo
On Tue, Mar 18, 2014 at 5:02 PM, Alicia Valdés
aliciavaldes1...@gmail.com wrote:
...
 However, what I attempt to do is to perform an indicator species analysis
 (ISA) with these residuals. I want to see if I can find species which are
 indicators for different environmental conditions, but first I would like
 to remove the differences in species composition due to the study region
 (which accounts in fact for a big part of the differences in species
 composition). I am using the packages indicspecies and labdsv for ISA but
 in none of the cases did I found a way of including this as, for example, a
 block variable, that's what I attempt to get the residuals.

Alicia,

following up on my previous comment, I think you might use the regions
as a typology on which to base your ISA. So you'll get the
characteristic species for each region and there is no need to
account for differences in species composition among regions
(moreover, I fail to understand why one might need to do so).

If you take a look at the help page for multipatt() in indicspecies,
you'll see that you need a community data table (your presence/absence
matrix) and a site classification (your regions if these are not
further classified into meaningful clusters; although you didn't
provide more details on how the forest patches relate to the regions
you wrote about) to run the analysis.

HTH,
Ivailo
-- 
The cure for boredom is curiosity. There is no cure for curiosity. --
Dorothy Parker

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


Re: [R-sig-eco] How to accommodate data with negative values for Canonical Correspondence Analysis in R using vegan Package

2014-02-26 Thread Ivailo
On Wed, Feb 26, 2014 at 2:43 PM, Rajendra Mohan panda
rmp.iit@gmail.com wrote:
...
 I have temperature data with negative values which I am not able to include
 for my CCA ordination. ...

Rajendra, I am curious -- why are you not able to include the negative
values in the CCA ordination?

-- 
The cure for boredom is curiosity. There is no cure for curiosity. --
Dorothy Parker

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


Re: [R-sig-eco] angular statistics

2013-10-17 Thread Ivailo
On Fri, Oct 18, 2013 at 6:16 AM, Michael Marsh sw...@blarg.net wrote:

 If you want a measure of exposure, i. e., heat, I suggest using the 
 heatload transformation suggested by McCune and Grace (2002). Their 
 assumption is that mid-afternoon, when the sun is in the southwest, is 
 usually the warmest time of day. The formula at the end of Chapter 3 follows:

 heat load index=(1-cos(degrees-45))/2

 McCune, Bruce and James B. Grace. 2002. Analysis of ecological communities. 
 MJM Software Design. Gleneden Beach, Oregon. USA

Thanks for the interesting discussion!

I'd like to add that although I don't have the book, I found the
radiation measures presented in the following paper:
McCune, B. and D. Keon. 2002. Equations for potential annual direct
incident radiation and heat load. Journal of Vegetation Science
13:603–606.

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] PCNM function

2013-08-21 Thread Ivailo
On Wed, Aug 21, 2013 at 9:19 PM, Valerie Mucciarelli
soccerm...@hotmail.com wrote:
...
 I receive this error:

 Error in moran.I.uni(eigenvector.mat[, i], mat.W, scaled = scaled, normalize 
 = normalize,  :
   could not find function boot
 Timing stopped at: 0 0 0.04

Hi Val,

the error message says that it cannot find the boot function, so try
install.packages(boot) and then library(boot) if you have it
installed.

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] Offsets in Poisson or Neg. Bin regression

2013-06-27 Thread Ivailo
On Wed, Jun 26, 2013 at 12:42 PM, Scott Foster scott.fos...@csiro.au wrote:
 Hi again Ivailo,

 Yes, the `offset' and the covariate are the same thing.  Including them both
 simply alters the functional form of the linear predictor in your model.
 No, they are not collinear in the typical sense as there is only one
 parameter (linear form) between them -- the offset term does not have a
 parameter that will be estimated associated with it.  For example, with log(
 effort) added as a linear covariate the log-link GLM is

 log( E(y)) = offset + beta * log( effort) + other_stuff = log( effort) +
 beta * log( effort) + other_stuff = beta_1 * log( effort) + other_stuff
 where beta_1=1+beta.

 If you test that beta==0 (which is not beta_1) then you are testing that the
 effect of effect is purely scaling (as per nomenclature before).  This is
 the same as McCullagh and Nelder's testing to see if beta_1==1.  Thanks for
 the pointer to McCullagh and Nelder -- I didn't know that they suggested
 that.

Thanks a lot for the brilliant explanation, Scott! Now things make
sense to me, and I'm interested what the modeling strategy would be if
beta_1 turns out to be significantly  1. Would the option you
mention below be viable alternative in that case?

 My depiction of the effect of effort as f( effort) is to allow for the
 possibility that the effect of effort may be non-linear on the link scale.
 A simple example is when f(effort) is a low-order polynomial.  Departures
 from effort being a purely scaling term may extend beyond linearity.  One
 may even want to consider regression splines or even more flexible GAMs.
 Having said all this though, it is my practice to be quite conservative with
 including effort as anything but a scaling variable (offset).  It seems to
 me that there needs to be good reason before jumping to strong conclusions
 that may have no basis in the phenomenon under study.

I imagine that the fishing-net example you mentioned earlier could be
a case of a non-linear effect of effort -- wouldn't this warrant
modeling the effort as being non-linear on the link scale?

Cheers,
Ivailo
--
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] Offsets in Poisson or Neg. Bin regression

2013-06-26 Thread Ivailo
On Tue, Jun 25, 2013 at 2:02 PM, Scott Foster scott.fos...@csiro.au wrote:
 Hi Ivailo,

 Good question.  Difficult to answer, which is probably why you haven't had
 any responses yet (that the list has seen).

 If you include an offset term with a log link function then you are assuming
 that the random variable (counts say) depend on the offset with a known
 relationship.  Generally, this is precisely what you want to do -- for
 example standardising counts for the sampling effort taken to obtain those
 counts.

 However, in some situations it is conceivable that the sampling effort
 itself affects the count random variable.  An example may be fish in a trawl
 net -- as the net gets full it becomes less and less efficacious.  In this
 case you may expect that a single unit of effort change will have different
 effect when there has been lots of previous effort to when there hasn't.

Thanks for commenting on that, Scott!

Although both alternatives you mention above assume that the RV
depends on either the offset or the sampling effort, but aren't
these are essentially the same?

 If I thought that I was in the latter case, I may fit a model like

 log( E( count)) = log( effort) + f(effort) + other stuff.

 The function f(effort) can take any form, including beta*log(effort).  In
 such a case a test of beta==0 is equivalent to testing if the effect of
 effort is purely scaling or if it is something else/sinister.  General forms
 of f(effort) may tell you much more but may also be much more confusing.

 To choose between the two cases above (offset versus offset+covariate), I
 would base my choice largely on prior knowledge of the system under study.
 This is especially so if I don't have much data.

My approach to modeling counts was primarily based on the widespread
advise that varying effort should be considered by adding an offset to
the model, but when I consulted the book by McCullagh and Nelder
(1989), I found on pp. 206-207 hat they actually estimated the
log(effort) term as being ~ 1. So started my confusion on the topic
to offset or to estimate ;-)

It never occurred to me, though, that the effort could be entered both
as an offset *and* as a covariate into the model. As these two terms
have good chances being collinear, I wonder how one can then separate
their influence on the RV. I do not fully understand your idea
regarding the form of the function f(effort) , but I get that if the
coefficient of effort is estimated as == 0, then it should be
concluded that effect of effort should be retained *only* as an offset
to account for the scaling. Am I right?

Thanks again for your elucidating comment,
Ivailo
--
UBUNTU: a person is a person through other persons.

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


[R-sig-eco] Offsets in Poisson or Neg. Bin regression

2013-06-19 Thread Ivailo
On Tue, Jun 18, 2013 at 11:10 AM, Matias Ledesma matutet...@hotmail.com wrote:


 Philip and Alain,

 Thank you for your assistence,
 So, that mean that the  fuction offset its only possible if there is a 
 relationship between the
 damaged number of embryos and the total number of embryos per amphipod as you 
 explained?

As I'm facing a similar problem, I'd like to know as well if a
variable should be passed as an offset to the formula only when it
influences the outcome in some (linear) way. Does it make sense to
include the exposure variable in the model as a regular input first,
and if it's coefficient is around 1 to be taken as an indicator that
it is better that variable to be included in the model as an offset?

Cheers,
Ivailo
--
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] quantifying directed dependence of environmental factors

2013-03-08 Thread Ivailo
On Thu, Mar 7, 2013 at 9:20 PM, Sarah Goslee sarah.gos...@gmail.com wrote:
...
 There's a fair bit of literature on Mantel-based path analysis, and
 other similar dissimilarity-based approaches. SEM can be used with
 composition as well, although not (I think) with the intermediate step
 of calculating dissimilarities.

 Besides journal articles employing those techniques, I like both of these:

 J. B. Grace, Structural Equation Modeling and Natural Systems,
 Cambridge University Press, Cambridge, UK, 2006.

 B. Shipley, Cause and Correlation in Biology: A User’s Guide to Path
 Analysis, Structural Equations and Causal Inference, Cambridge
 University Press, Cambridge, UK, 2000.

I recently stumbled on a great book on path modelling using PLS (with
R) that is freely downloadable at http://is.gd/BxqIEL

Ivailo
--
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] Defining Different Groups with Nonparametric Data (vegan package)

2012-11-26 Thread Ivailo
On Sun, Nov 25, 2012 at 6:32 PM, Charles Jones cnjo...@vt.edu wrote:
 Professor Oksanen:

 Thanks for the reply and sorry for the confusion! (I'm still trying to wrap
 my head around the multivariate lingo.)


 1.)  The scores from my NMDS analysis are non-normal (tested using the
 multivariate Shapiro-Wilks test.)
 2 and 3)  I am using these scores as input for the Cluster Analysis (Ward's
 Method) to define several different groups.  One of the underlying
 assumptions associated with Wards algorithm is that the input is normal.

 So, the question is, is it okay to ignore that assumption (normality of
 input data) to define the groups?  Since I used the MMRP test
 (nonparametric) to show there is a difference between the groups, it seems
 like this is reasonable.  However, I wasn't quite sure.

 Thanks Again!
 Nate Jones

Nate,

IIRC Ward's method assumes multivariate normality of each cluster
formed by multivariate observations (as it treats cluster analysis as
an ANOVA problem and so it is sensitive to outliers), but as this
method tends to create rather small clusters I would suggest you to
try some of the other algorithms available in R to test the stability
of the clustering obtained by Ward's linkage.

However, I wonder why do you need to get trough the NMDS step -- can't
you directly cluster the cases in your dataset? Something like:

distances - dist(USArrests, method = euclidean) # we need Euclidean
distances here
fit - hclust(distances, method=ward) # Ward's method
plot(fit) # plot dendrogram
grps - cutree(fit, k=5) # suppose you can interpret 5 clusters
rect.hclust(fit, k=5, border=red) # add red boxes around the 5
clusters in dendogram

Then, you could experiment with mmrp() and different grouping indexes
(obtained from different cuts trough the dendrogram), but I am not
sure if this wouldn't be regarded as circular reasoning.

Cheers,
Ivailo
--
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] Post-hoc test after rm-ANOVA

2012-09-14 Thread Ivailo
On Fri, Sep 14, 2012 at 1:55 PM, Nils Gülzow nils.guel...@gmx.de wrote:
 Dear community,

 I have a general statistic question. I have done a rm-Anova with
 ezAnova package. My rm-Anova  was a mixed within-and-between,
 design, containing two factors (each has two levels) for between and
 the sampling days for within. The ezAnova worked fine and now I would
 like to perform a Post-hoc test (like TukeyHSD) to get the significant
 differences between the factors over time.

 Is it simply using the TukeyHSD to test the differences between the
 factors or how can I get the significant difference between the
 factors over time?

 Thanks in advance,
 Nils
 Nils Gülzow

Dear Nils,

if you'd like to stick the the ezAnova package, then the ezPlot()
function produces error bars that might help you to visually evaluate
post-hoc comparisons. You can always run TukeyHSD() on an aov() object
or use glht() from the multcomp package if you have a lm() object.

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] option --enable-R-shlib

2012-06-15 Thread Ivailo
On Fri, Jun 15, 2012 at 7:05 AM, Michel Rapinski mrapi...@uottawa.ca wrote:
 Hello,

 How can I check if my the R program that I've installed is compiled with
 the option --enable-R-shlib?

Michel,

You can check this by using the command ldd /usr/lib/R/bin/exec/R.
If libR.so (the shared R library) appears in the resulting list,
then you have R built with  --enable-R-shlib.

 And, if need be, how do I enable that option?

If needed, you can enable this option during the build process by
passing the option, e.g. ./config --enable-R-shlib, just before make.

Hope this helps,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] option --enable-R-shlib

2012-06-15 Thread Ivailo
On Fri, Jun 15, 2012 at 6:20 PM, Michel Rapinski mrapi...@uottawa.ca wrote:
 Hi Ivailo,

 Do I run this command in R? Or in terminal? Maybe I should have added that
 I have a mac, I don't know if that makes a difference.

Sorry, Michel, I missed to mention that ldd needs to be run in the
terminal, and don't forget to provide the correct path to the R
executable. You can check http://v.gd/ZPswag for further details on
how to build R under Mac OS X.

Good luck,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] species richness

2012-05-31 Thread Ivailo
On Wed, May 30, 2012 at 10:42 PM, Linda Bürgi patili_bue...@hotmail.com wrote:

 Hi,


 I am interested in testing whether increasing the number of plant
 species sampled increases the number of herbivore species I find, irrespective
 of the number of herbivores collected.


 To do that, I was thinking of fixing the number of
 herbivores collected (e.g. 100) and randomly pulling 99 samples of 100
 herbivores from all possible combinations of 2 plant species, 3 plant species,
 4 plant species, etc. This should then yield a curve with number of plant
 species on the x axis and average number of herbivore species found on the y
 axis, always for a sample of 100 herbivores.


 Does such a function already exist?


 My data (see below) is in matrix form with columns representing
 herbivore species (14) and rows representing plant species (14), with the 
 numbers in the
 cells representing number of specimens collected per herbivore and plant
 species combination.


 I’m not quite sure how to tackle this….


 Thanks!



 Linda

Hi Linda,

your question whether increasing the number of plant species sampled
increases the number of herbivore species seems to require a
contingency table and a corresponding test. I am not sure, however,
how to treat the requirement irrespective of the number of herbivores
collected as usually the number of species increases with the number
of individuals sampled. Perhaps to test additionally if the proportion
of herbivores sampled is independent of the proportion of
hon-herbivores in the sample(s)?

Hope this helps,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] QIC (quasi-likelihood information criterion) in gee

2012-05-10 Thread Ivailo
On Thu, May 10, 2012 at 3:51 PM, Wagner Tassinari
wtassin...@yahoo.com.br wrote:
 Hi, I'd like to know how extract the QIC (quasi-likelihood information
 criterion) in GEE model (using gee or geeglm commands) in R.

Hi Walter!

I think this - http://is.gd/myQ6IZ - could help.

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] Testing difference between diversity indices with vegan::oecosimu

2012-04-26 Thread Ivailo
On Thu, Apr 26, 2012 at 12:17 AM, Kay Cichini kay.cich...@gmail.com wrote:
 Hello all,

 I'd like to test if total diversity differs between two communities. For
 each community several samples were taken and abundances collapsed over
 groups to compute total diversity for each group. I tried to use
 vegan::oecosimu to test non-randomness of my statisitc (difference in
 Simpson-Diversity indices of collapsed abundances) - however, I am not
 quite sure if I oversee posssible pitfalls:

 library(vegan)
 data(dune)

 # a grouping variable:
 gr - gl(2, nrow(dune)/2)

 divdiff - function(x) abs(diversity(colSums(x[gr == 1, ]), simp) -
                           diversity(colSums(x[gr == 2, ]), simp))
 # testing function:
 divdiff(dune)

 oecosimu(dune, divdiff, r2dtable, nsimul = 1999)
 # oecosimu with 1999 simulations
 # simulation method r2dtable
 # alternative hypothesis: true mean is not equal to the statistic
 #           statistic        z     2.5%      50% 97.5% Pr(sim.)
 # statistic   0.00275 -0.20996  0.00013  0.00280  0.01     0.98

Dear Kay,

I am not sure about any possible pitfalls with your approach, but I
have tested the same data using the randomisation functions of the
rich library, and found that neither the Simpson diversity nor the
simple species richness differ significantly among the defined groups.

Here are the results following your example:

library(rich)

# prepare data
one - as.data.frame(dune[gr == 1, ])
two - as.data.frame(dune[gr == 2, ])

data - list(one, two)

# compare cumulative species richness
c2cv(com1=data[[1]],com2=data[[2]],nrandom=1999)
#$res
#
#cv1  27.
#cv2  28.
#cv1-cv2  -1.
#p 0.4220 # N.S.
#quantile 0.025   -4.
#quantile 0.9754.
#randomized cv1-cv20.0225
#nrandom1999.

# compare the Simpson diversity
simp.one - diversity(dune[gr == 1, ], simp)
simp.two - diversity(dune[gr == 2, ], simp)
c2m(pop1=simp.one,pop2=simp.two,nrandom=1999,verbose=FALSE)
#done.
#$res
#
#mv1 8.630e-01
#mv2 8.773e-01
#mv1-mv2-1.439e-02
#p   2.440e-01 # N.S.
#quantile 0.025 -3.456e-02
#quantile 0.975  3.351e-02
#randomized mv1-mv2  3.899e-04
#nrandom 1.999e+03
#

The possible pitfalls might be hidden under the different results ;-)

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] How to calculate geographical coordinates of sampling points following (by bearing and distance) a georeferenced one?

2012-04-09 Thread Ivailo
On Fri, Apr 6, 2012 at 10:26 PM, Tammy Wilson t...@aggiemail.usu.edu wrote:
 Trigonometry will work for projected coordinate systems like UTM:

 Try this:
 # number of points
 n = 30

 # reference location
 ref.pt = cbind(1,2)

 # generate some random directions
 # This can be your list of your bearings converted to radians
 dir - runif(n,0,2*pi )

 # generate some random distances
 # This can be your list of distances in map units (e.g. m)
 dist - runif(n,0.5,10)

 #empty matrix for coordinates
 coords.mat = cbind(rep(0,n),rep(0,n))

 #using trigonometry to calculate object location
 for (i in 1:n){
              coords.mat[i,1] = ref.pt[1]+(sin(dir[i])*dist[i])
              coords.mat[i,2] = ref.pt[2]+(cos(dir[i])*dist[i])
        }
 plot (coords.mat)
 points(ref.pt,col=2)

 Best,
 Tammy

Thank you for the code, Tammy! Meanwhile Michael Summer pointed my
attention the the geosphere package and the destPoint() function seems
to do exactly what I was
searching for.

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


[R-sig-eco] How to calculate geographical coordinates of sampling points following (by bearing and distance) a georeferenced one?

2012-04-05 Thread Ivailo
Der fellow R-users,

I have several sampling sites and in each site the starting plot
(i.e. the first one that have been sampled) is georeferenced with a
GPS but the following ones are just described by their distance and
bearing in relation to the previous one.

Is there a quick way to calculate (by using some of the spatial
R-packages) the geographic coordinates of the sapling plots at each
location that have not been explicitly georeferenced?

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] adonis: error in rowSums

2012-02-09 Thread Ivailo
On Wed, Feb 8, 2012 at 4:10 PM, Caroline Wallis c.wal...@worc.ac.uk wrote:
 I am trying to use the 'adonis' function in the 'vegan' package to assess 
 differences in water depth and water velocity between areas of a river 
 channel categorised by surface flow type (6 types in total, unequal sample 
 sizes).

 Sample Data (LB):

 SFT     Depth   Vel
 BSW     0.18    1.2
 BSW     0.16    1.03
 BSW     0.16    0.98
 BSW     0.22    0.53
 BSW     0.11    0.668
 BSW     0.14    0.432
 BSW     0.12    0.391
 BSW     0.16    0.647
 BSW     0.2     0.903
 BSW     0.3     0.594
 BSW     0.37    0.429
 

 The dependent data was used in data frame format, rather than a dissimilarity 
 matrix.

 Using the call 
 'adonis(formula=SFT~Depth*Vel,data=LB,permutations=999,method=canberra,strata=NULL)'
  I get the following error:

Dear Caroline,

on a second thought I realized that you might want to flip  the
variables in your adonis() call so that Depth and Vel are the
dependent variables and SFT the predictor.

Something like:

# create a dataframe containing the dependent variables; sampledata
is the data frame you posted a sample of
dep.var - data.frame(sampledata[,2:3])

# extract the predictor variable
pred.var - sampledata[,1]

# perform MANOVA
model - adonis(dep.var ~ pred.var, permutations = 999,method =
canberra, strata = NULL)

Hope this helps,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] Comparison of gam and gamm fits

2012-02-08 Thread Ivailo
On Wed, Feb 8, 2012 at 11:17 AM, Thackeray, Stephen J. s...@ceh.ac.uk wrote:
 Dear all,

 My apologies, the figure seems to have been removed from the mail! Hope this 
 attachment makes it instead...

 Steve

Dear Steve,

attachments are generally stripped off the message, so try hosting the
figure somewhere and post the link instead.

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] adonis: error in rowSums

2012-02-08 Thread Ivailo
On Wed, Feb 8, 2012 at 4:10 PM, Caroline Wallis c.wal...@worc.ac.uk wrote:
 I am trying to use the 'adonis' function in the 'vegan' package to assess 
 differences in water depth and water velocity between areas of a river 
 channel categorised by surface flow type (6 types in total, unequal sample 
 sizes).

 Sample Data (LB):

 SFT     Depth   Vel
 BSW     0.18    1.2
 BSW     0.16    1.03
 BSW     0.16    0.98
 BSW     0.22    0.53
 BSW     0.11    0.668
 BSW     0.14    0.432
 BSW     0.12    0.391
 BSW     0.16    0.647
 BSW     0.2     0.903
 BSW     0.3     0.594
 BSW     0.37    0.429
 

 The dependent data was used in data frame format, rather than a dissimilarity 
 matrix.

 Using the call 
 'adonis(formula=SFT~Depth*Vel,data=LB,permutations=999,method=canberra,strata=NULL)'
  I get the following error:

 Error in rowSums (x, na.rm=TRUE)
 'x' must be an array of at least two dimensions

 I examined the adonis code to find 'x'. It first appears at the permutation 
 stage:

 if (missing(strata))
        strata - NULL
    p - sapply(1:permutations, function(x) permuted.index(n,
        strata = strata))
    tH.s - lapply(H.s, t)
    tIH.snterm - t(I - H.snterm)
    f.perms - sapply(1:nterms, function(i) {
        sapply(1:permutations, function(j) {
            f.test(tH.s[[i]], G[p[, j], p[, j]], df.Exp[i], df.Res,
                tIH.snterm)

 However I'm no closer to understanding what 'x' is or how to correct the 
 error. If anyone could offer any advice or help I'd be very grateful.

 I also tried transposing the data but this generated a different error!

 Regards,

 Caroline Wallis

Dear Caroline,

you need to provide a community table (i.e. species x samples data
frame) to adonis, but you have provided a single categorical variable.
Therefore I am not sure if the adonis() function would be appropriate
for the analysis you're trying to perform.

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

___
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 concerning nmds.min

2012-02-02 Thread Ivailo
2012/2/2 Gian Maria Niccolò Benucci gian.benu...@gmail.com:
 Hi all,

 I am trying to run a nmds with function nmds()
 Once I run the following code I wonder how to look to the R2 and stress
 value of the chosen configuration.

 iris.nmds - nmds(iris.md, mindim=2, maxdim=2, nits=50)

 iris.nmin - nmds.min(iris.nmds)


 Which among the 50 configuration the functions chose?
 How to look to its stress and R2 values?


 If I type iris.nmin I only got the X1 and X2 coordinates...


 Thanks in advance,

 Gian

Dear GIan,

try the following:

library(vegan)
data(dune)
sol - metaMDS(dune)
sol

Call:
metaMDS(comm = dune)

global Multidimensional Scaling using monoMDS

Data: dune
Distance: bray

Dimensions: 2
Stress: 0.1183195
Stress type 1, weak ties
Two convergent solutions found after 5 tries
Scaling: centring, PC rotation, halfchange scaling
Species: expanded scores based on 'dune'


Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

___
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 concerning nmds.min

2012-02-02 Thread Ivailo
2012/2/2 Gian Maria Niccolò Benucci gian.benu...@gmail.com:
...
 Which among the 50 configuration the functions chose?
 How to look to its stress and R2 values?

Forgot about the R-squared - according to the vegan FAQ 1 - stress^2
transforms nonlinear stress into quantity analogous to squared
correlation coefficient. Function stressplot displays the nonlinear
fit and gives this statistic.

HTH,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] glmmADMB v 0.7.1

2012-01-12 Thread Ivailo
On Thu, Jan 12, 2012 at 7:09 PM, Christopher Rota
ctr...@mail.missouri.edu wrote:
 Hi Mollie,

 Thanks for your help.  I had the same thought and ran this model with my
 categorical variables as factors, with the same result.  I use the dummy
 variables simply because it gives me more control over how I interpret my
 intercept parameter (I'm not sure if / how one can control which categorical
 variable is the intercept in glmmadmb).

 Thanks again,

 Chris

Dear Chris,

if I remember correctly, although 32-bit Windows can be set-up to use
more that 4GB RAM it cannot provide more than ~2GB to any process.
Perhaps you need to try running your model on a 64-bit machine.

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] fitting multiple variance structures in gamm

2012-01-05 Thread Ivailo
On Thu, Jan 5, 2012 at 11:30 AM, Marc Taylor marchtay...@gmail.com wrote:
 Dear r-sig-ecology group,

 I am trying to fit a variance structure to two different covariates at once
 using varComb (nlme package) in a gamm (mgcv package) model. When I fit the
 same type of variance structure to each covariate individually, soolutions
 were found and the improvements were significant. However the fitting of
 both covariates at once does not find a solution and results in an error.
 Does anyone have any suggestions for me? Below is an example from my script.

 Many thanks in advance,
 Marc


 I set up the combined variance structure in this way:
 varstrComb - varComb( varConstPower (form = ~  COV1 ),varConstPower
 (form = ~  COV2 ) )


 Then fit the model:
 gamm(fmla, data=db, weights=varstrComb, method=REML)


 I receive the following Error message:
 Error in solve.default(-val) :   Lapack routine dgesv: system is exactly
 singular

Dear Marc,

as the error message says, it appears that the covariance matrix is
singular and.cannot be inverted. You should check your covariates to
see if one of these is not a function of the other.

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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


Re: [R-sig-eco] Nestedness analyses in Vegan

2011-12-05 Thread Ivailo
On Mon, Nov 28, 2011 at 8:32 PM, Ricardo Solar rrso...@gmail.com wrote:
 Hi people;

 I'm thinking about a solution to show that a sample coming from 3 types of
 killing solutions are nested. However, when I tried to do this with
 nestedness function in Vegan I couldn't specify the groups. I guess it's
 impossible at all, so my question is: is there any other analysis where I
 can show this nestedness pattern?

 Att, RSolar

Dear Ricardo,

as you didn't specify your data structure (and that is important for
successfully performing a nestedness analysis), we have to guess it.
In in any case it should be entered as community data - i.e. site x
species incidence matrix. An interesting aspect of your question is
how you should organise the community data - will you have three
separate matrices and compare the nestedness metric among them or will
you combine these in one common matrix to study (common) species
responses to the three killing solutions. I don't have an answer for
that, but perhaps someone on the list might provide further insight...

Cheers,
Ivailo
-- 
UBUNTU: a person is a person through other persons.

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