[R-sig-eco] student seeking help for ecological analysis in marine ecology

2009-10-03 Thread Roman Luštrik
Hello List-o-members,

my name is Roman Lustrik and I'm a student of biology-ecology at the
University of Ljubljana. I am nearing the end of my formal education path
and a graduation thesis is in order. I have hooked up with marine biologists
from our only research station in Piran and together, we sampled hard bottom
sediments along the entire Slovenian coast. My responsibility was gathering
data on polychaetes. Along side, I was made available a number of other
data, including algae cover and geomorphological parameters of sampling
sites.

I was hoping I could run all the analyses using R and make this somewhat
central theme of my thesis. Hopefully, this would help spur future students
in taking up professional open source software solutions like R. To my
knowledge, R has not been of central theme in grad theses in ecology
analysis in Slovenia.
Since I'm somewhat new to ecological analyses I was hoping someone
subscribing to this list could lend me a hand with a hint of literature
relevant to my subject (a book, a paper or something that would start me off
with relevant analyses). While I do have a formal mentor who is keeping in
order the biological part of my thesis, I am fully susceptible to guidance
from a willing co-mentor who is working in R and ecology.

If anyone can help me in any way as described above, it would be most
appreciated.

With best wishes,
Roman

[[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] trouble with BiodiversityR:diversityresult function

2009-10-12 Thread Roman Luštrik
Hello list,

I have a felling this is a generic error but nonetheless, it has been
bugging me extensively. If anyone can chip in, I would most appreciate.

I'm trying to calculate expected species richness, following Kindt&Coe Tree
diversity analysis from my dataset but I get the following error:

> divjack <- diversityresult(PoCom, index="Jack.1")
Error in round(result, digits = digits) :
  Non-numeric argument to mathematical function

PoCom is a community data.frame with rows as locations and columns as
species (as in test dataset called "dune" in the book mentioned earlier).
Here is a head(PoCom) and first few lines of str(PoCom):

> head(PoCom)
Sal_idae Pil_mili Syl_idae Ner_sp. Ner_rava Sab_spin Neo_pseu
HM1   12   145  1311   28
HM2  1235  113  28   44   170
HM3   13   558  40027
HM4  141   23   56  91   7460
HM570   20  18   11  1140
HM6   13   140   70   398

> str(PoCom)
'data.frame':   10 obs. of  83 variables:
 $ Sal_idae : int  12 123 13 141 7 13 289 318 99 124
 $ Pil_mili : int  14 5 55 23 0 14 15 23 86 138
 $ Syl_idae : int  5 113 8 56 20 0 45 122 0 2
 $ Ner_sp.  : int  13 28 40 91 18 7 42 41 24 0
 $ Ner_rava : int  1 44 0 74 11 0 16 34 0 35
 $ Sab_spin : int  1 17 2 6 114 39 0 8 2 0
 $ Neo_pseu : int  28 0 7 0 0 8 3 0 12 99

Debugging stops here:

Browse[1]> n
debug: if (method != "jackknife") {
result2 <- round(result, digits = digits)
result2 <- data.frame(result2)
colnames(result2) <- index
}
Browse[1]> n
debug: result2 <- round(result, digits = digits)
Browse[1]> n
Error in round(result, digits = digits) :
  Non-numeric argument to mathematical function

[[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] interpreting adonis()

2009-11-22 Thread Roman Luštrik
Can someone nudge me into the right direction on how to interpret adonis()?
anosim() is fairly simple though its barplot with notches, but mr. Oksanen
recommends adonis(), which is less intuitive. I hope this is not too trivial
issue for this list.

Best wishes,
Roman

[[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] anosim, mrpp and adonis

2009-12-17 Thread Roman Luštrik
Dear List,

I'm trying to see if samples within and between locations differ (in case
they don't, I will have an argument to join subsamples into one). I have
tried ANOSIM and mrpp.

anosim.result <- with(environmental.sub, anosim(community.sub.dist,
station)) #station is used as "strata"
mrpp.result <- with(environmental.sub, mrpp(community.sub.dist, station))#ditto

ANOSIM produces a barplot with "skewed" notches (Crawley (2007) notes that
this is due to small sample size and high within-sample variance) and mrpp
Pvalue is 0.001.

My question would be, in what way can I see between and within differences
in mrpp (can I plot this?) and how would a similar method be done in
adonis() (both ANOSIM and mrpp help files link to adonis as a more
appropriate method)? I have tried as displayed below, but clearly this is
not the solution (or am I missing something?). Can anyone advise on how to
improve it to match what I'm trying to achieve with ANOSIM/mrpp?

1> adonis.result <- adonis(community.sub.dist ~., data=environmental.sub,
strata=environmental.sub$station, permutations=999)
1> adonis.result

Call:
adonis(formula = community.sub.dist ~ ., data =
environmental.sub[1:41],  permutations = 999, strata =
environmental.sub$station)

Df SumsOfSqs  MeanSqs  F.Model R2 Pr(>F)
Acet_acet  1.0   0.33879  0.33879  1.48305 0.0212  0.481
Cor_off1.0   0.71387  0.71387  3.12492 0.0446  0.082 .
Cyst_barb  1.0   0.71871  0.71871  3.14610 0.0449  0.369
Cyst_comp  1.0   0.32404  0.32404  1.41845 0.0203  0.606
Cyst_comp_ros  1.0   0.37623  0.37623  1.64695 0.0235  0.027 *
Cyst_sp1.0   0.24372  0.24372  1.06686 0.0152  0.451
Flab_pet   1.0   0.30608  0.30608  1.33986 0.0191  0.557
Halim_tun  1.0   0.21332  0.21332  0.93381 0.0133  0.589
Hali_virg  1.0   0.51746  0.51746  2.26517 0.0323  0.206
Halo_inc   1.0   0.35300  0.35300  1.54523 0.0221  0.531
Hyd_spp1.0   0.28498  0.28498  1.24748 0.0178  0.429
Jani_sp1.0   0.18746  0.18746  0.82058 0.0117  0.657
Lith_spp   1.0   0.43930  0.43930  1.92300 0.0275  0.338
Pad_pav1.0   0.40596  0.40596  1.77706 0.0254  0.667
Pey_poly   1.0   0.48543  0.48543  2.12495 0.0303  0.292
Pey_squa   1.0   0.42382  0.42382  1.85525 0.0265  0.336
Phy_sp 1.0   0.62091  0.62091  2.71802 0.0388  0.062 .
Zan_prot   1.0   0.37720  0.37720  1.65119 0.0236  0.194
Cer_spp1.0   0.32339  0.32339  1.41564 0.0202  0.051 .
Chae_sp1.0   0.30489  0.30489  1.33465 0.0191  0.443
Cham_parv  1.0   0.25843  0.25843  1.13127 0.0162  0.246
Clad_spp   1.0   0.29642  0.29642  1.29755 0.0185  0.458
Clad_spong 1.0   0.24449  0.24449  1.07024 0.0153  0.294
Dict_dich  1.0   0.47976  0.47976  2.10012 0.0300  0.316
Dict_lin   1.0   0.35908  0.35908  1.57184 0.0224  0.881
Dict_poly  1.0   0.35593  0.35593  1.55807 0.0222  0.504
Entero_sp  1.0   0.31754  0.31754  1.38999 0.0198  0.479
Gel_lla_sp 1.0   0.12456  0.12456  0.54526 0.0078  0.757
Gel_sp 1.0   0.29574  0.29574  1.29459 0.0185  0.310
Gig_aci1.0   0.31233  0.31233  1.36722 0.0195  0.431
Grac_burs  1.0   0.26052  0.26052  1.14041 0.0163  0.704
Halo_scop  1.0   0.35658  0.35658  1.56091 0.0223  0.282
Laur_spp   1.0   0.58577  0.58577  2.56420 0.0366  0.074 .
Poly_sp1.0   0.17517  0.17517  0.76681 0.0109  0.558
Pter_cap   1.0   0.21960  0.21960  0.96127 0.0137  0.292
Spha_spp   1.0   0.24061  0.24061  1.05326 0.0150  0.506
Ulva_sp1.0   0.46203  0.46203  2.02252 0.0289  0.091 .
Valo_utri  1.0   0.14743  0.14743  0.64537 0.0092  0.837
Wrang_peni 1.0   0.26278  0.26278  1.15029 0.0164  0.417
Residuals 10.0   2.28443  0.22844  0.1428
Total 49.0  15.99776   1.
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


Cheers,
Roman

[[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] db-MRT leaves

2009-12-19 Thread Roman Luštrik
Dear Mr. or Mrs/Ms. List,

I'm trying to plot a db-MRT (mvpart package) with the following code:

#preparing left side of the equation
m4.gdist <- gdist(community, meth="bray", full=T, sq=TRUE)
colnames(m4.gdist) <- c("HM1", "HM2", "HM3", "HM4", "HM5", "HM6", "HM7",
"HM8", "HM9", "HM10") #"pretty" column/row names
rownames(m4.gdist) <- c("HM1", "HM2", "HM3", "HM4", "HM5", "HM6", "HM7",
"HM8", "HM9", "HM10") #"pretty" column/row names

m4 <- mvpart(m4.gdist ~
Acet_acet+Cor_off+Cyst_barb+Cyst_comp+Cyst_comp_ros+Cyst_sp+Flab_pet+Halim_tun+Hali_virg+Halo_inc+Hyd_spp+Jani_sp+Lith_spp+Pad_pav+Pey_poly+Pey_squa+Phy_sp+Zan_prot+Cer_spp+Chae_sp+Clad_spp+Clad_spong+Dict_dich+Dict_lin+Dict_poly+Entero_sp+Gel_lla_sp+Gel_sp+Gel_lat+Gig_aci+Grac_burs+Halo_scop+Laur_spp+Nith_punc+Poly_sp+Pter_cap+Spha_spp+Ulva_sp+Valo_utri+Wrang_peni,
data=env.mvpart, method="dist", xv="p")

Here is the 
result.
Shouldn't leaves contain barplots or am I missing? I have been scanning the
str(m4) results, but I can't find anything that would tell me something more
about the leaves. If I change the method in mvpart() to "mrt", the barplots
appear.

Cheers,
Roman

[[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] ordiplot3d

2010-01-18 Thread Roman Luštrik
I'm trying to plot a CCA plot in 3D with ordiplot3d().
Is there a way to plot vertical lines for sites (type="h") as dashed,
instead of solid, which is the default?

Here is the code I use if of any help:

cca.plot3d <- ordiplot3d(CCA, type="h", angle=40)
text(cca.plot3d, "points", pos=c(4, 4, 2, 4, 3, 4, 2, 2, 4, 2))
text(cca.plot3d, "arrows", cex=0.7)
points(cca.plot3d, "points")

Cheers,
Roman

[[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] ordiplot3d

2010-01-19 Thread Roman Luštrik
Thank you Jari and Ben.
I have tried something along the lines what Ben suggested but stopped and
asked here if there's a better way, as I didn't want to invent the wheel
(yet crude one).

Cheers,
Roman



2010/1/18 Ben Bolker 

>  I think it's easier than that ... This looks doable by setting
> par(lty=2) before you draw the plot, then setting lty.axis and lty.grid
> to override that setting ...
>
> >  data(dune.env)
> >  ord <- cca(dune ~ A1 + Moisture, dune.env)
> >  ordiplot3d(ord)
> > par(lty=2)
> >  ordiplot3d(ord,type="h")  ## oops, everything is dashed
> >  ordiplot3d(ord,type="h",lty.axis=1,lty.grid=1)
>
>  However, this also draws everything else --  the biplot arrows and
> coordinate axes that ordiplot3d() adds to the basic scatterplot3d plot
> -- with dashed lines as well, which you might not want.  To override
> this you would have to hack ordiplot3d in some way -- the easiest thing
> would be to add lty=1 to the pl$points3d() and arrows() calls, or to
> add par() calls before and after the scatterplot3d() call to set lty
> to 2 (or whatever) and then change it back to lty=1 again.
>
>  Ben Bolker
>
> Jari Oksanen wrote:
> > Roman,
> >
> >
> > On 18/01/2010 19:35, "Roman Luštrik"  wrote:
> >
> >> I'm trying to plot a CCA plot in 3D with ordiplot3d().
> >> Is there a way to plot vertical lines for sites (type="h") as dashed,
> >> instead of solid, which is the default?
> >>
> > I don't know a way to achieve this. The ordiplot3d() uses scatterplot3d()
> of
> > the scatterplot3d package, and passes all arguments to that underlying
> > function. Howevever, scatterplot3d() seems to have no option of setting
> > vertical segments in type = "h" and therefore ordiplot3d cannot set them.
> > The only way seems to be to edit the code of scatterplot3d and add an
> > argument for the purpose.
> >
> > Cheers, Jari Oksanen
> >
> >> Here is the code I use if of any help:
> >>
> >> cca.plot3d <- ordiplot3d(CCA, type="h", angle=40)
> >> text(cca.plot3d, "points", pos=c(4, 4, 2, 4, 3, 4, 2, 2, 4, 2))
> >> text(cca.plot3d, "arrows", cex=0.7)
> >> points(cca.plot3d, "points")
> >>
> >> Cheers,
> >> Roman
> >>
> >> [[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-ecology mailing list
> > R-sig-ecology@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
> --
> Ben Bolker
> Associate professor, Biology Dep't, Univ. of Florida
> bol...@ufl.edu / people.biology.ufl.edu/bolker
> GPG key: people.biology.ufl.edu/bolker/benbolker-publickey.asc
>
>

[[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] ordiplot3d

2010-01-19 Thread Roman Luštrik
Dear list,

I am very excited to relay that I have managed to modify my plot, kudos to
Jari's tweak.

http://i53.photobucket.com/albums/g67/romunov/trash/cca.png
http://i53.photobucket.com/albums/g67/romunov/trash/cca_solid.png



2010/1/19 Uwe Ligges 

> Jari,
>
> thank you, I will appply the requested change and submit a new version to
> CRAN soon.
>
> Do you have a one liner for the help page as well?
>
> Best wishes,
> Uwe
>
>
>
>
>
> On 19.01.2010 09:47, Jari Oksanen wrote:
>
>> On 19/01/10 10:17 AM, "Roman Luštrik"  wrote:
>>
>>  Thank you Jari and Ben.
>>> I have tried something along the lines what Ben suggested but stopped and
>>> asked here if there's a better way, as I didn't want to invent the wheel
>>> (yet crude one).
>>>
>>>  Roman,
>>
>> I think the only sustainable alternative is to edit scatterplot3d(). This
>> is
>> not very difficult. The following adds argument type.hplot for the line
>> type
>> of vertical segments in type = "h" plots:
>>
>> --- scatterplot3d.R.orig2010-01-19 10:38:36.0 +0200
>> +++ scatterplot3d.R2010-01-19 10:41:25.0 +0200
>> @@ -12,6 +12,7 @@
>>   font.axis = par("font.axis"), font.lab = par("font.lab"),
>>   lty.axis = par("lty"), lty.grid = par("lty"), lty.hide=NULL,
>> - log = "", ...)
>> + lty.hplot = par("lty"), log = "", ...)
>>   # log not yet implemented
>> + ## lty.hplot sets the lty for line segments in type = "h"
>>  {
>>  ## Uwe Ligges,
>> @@ -249,5 +250,5 @@
>>  if(type == "h") {
>>  z2<- dat$y * yz.f + z.min
>> -segments(x, z, x, z2, col = col, cex = cex.symbols, ...)
>> +segments(x, z, x, z2, col = col, cex = cex.symbols, lty =
>> lty.hplot, ...)
>>  points(x, z, type = "p", col = col, pch = pch, cex = cex.symbols,
>> ...)
>>  }
>>
>> Cheers, Jari
>>
>>
>
>

[[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] nmds in 3D

2010-01-19 Thread Roman Luštrik
Dear list,

I have produced an nMDS plot with stress of 2.5 for first two dimensions. It
is my understanding this is _very_ poor support. When I run the procedure in
three dimensions (k=3), the stress value drops into the bucket and lands at
0.006. I have compared both plots and judging by feel alone I would say the
3D interpretation doesn't offer much more information than 2D (but see for
yourself: 2Dand
3D ). Would
it be sensible to use 3D plots for interpretation instead of the "common" 2D
based on stress value alone?

Cheers,
Roman

[[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] advice on joining replicates

2010-01-21 Thread Roman Luštrik
Dear List,

I realize my question may not be as R related as expected, but hopefully
subscribers will overlook this and hopefully offer some advice.
I have 10 stations with each station having 5 replicates (50 samples in
total). I would like to join the replicates into one sample for further
analysis. Unfortunately I can't find how other studies joined replicates
(most paper I've read only note how they grouped species). Due to lack of
references, I joined samples around their median. This shrunk my initial
dataset of 83 species to 29. If I follow the advice by Warwick and Clarke
(PRIMER-E manual) and remove species contributing less than 1 or 2% to total
abundance, I end up with 14 and 11 species, respectively. Is there a better
way of grouping replicates than by median?

Cheers,
Roman

[[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] na.exclude in vegan

2010-02-19 Thread Roman Luštrik
I think you're looking for na.omit. From ?cca:

Choice na.omit  removes
all rows with missing values.



On Fri, Feb 19, 2010 at 9:24 PM, L Quinn  wrote:

>
>
> Hello,
>
> I am attempting a cca in vegan with a dataset with missing values in both
> the community dataset and the environmental dataset. I tried entering
> commands for na.omit or na.exclude, but didn't have any luck. Perhaps I'm
> entering them in the wrong format?
>
> #Original problem
> > cca.ind<-cca(ind~.,env)
> Error in na.fail.default(list(DelN = c(2L, NA, NA, NA, 3L, 13L, 7L, NA,  :
>  missing values in object
>
> #First attempt at na.exclude; no different from original problem:
> > cca.ind<-cca(ind~.,env,na.action=na.exclude)
> Error in na.fail.default(list(DelN = c(2L, NA, NA, NA, 3L, 13L, 7L, NA,  :
>  missing values in object
>
> #Second attempt at na.exclude; different error message at least!:
> > cca.ind<-cca(ind~.,env,na.exclude=TRUE)
> Error in model.frame.default(data = env, na.exclude = TRUE, na.action =
> function (object,  :
>  variable lengths differ (found for '(na.exclude)')
>
> A subset of my env dataset:
> > env
>   DelN DelC  R24  GPP   TP  FRP   TN  NOx  NH3  DOC canopy velocity  pH
>  Cond
> 1 2  -44 0.13 0.10 0.01 0.00 0.28 0.01 0.02  6.4 81.9040.251 5.2
> 138
> 2NA   NA   NA   NA 0.06 0.01 0.64 0.00 0.02  8.6 91.9920.000 6.0
> 217
> 3NA   NA   NA   NA 0.04 0.01 0.32 0.06 0.02  4.9 80.0320.407 6.4
> 254
> 4NA   NA   NA   NA 0.07 0.00 0.70 0.00 0.07 21.7 95.5280.037 5.7
> 273
> 5 3  -34 0.14 0.13 0.11 0.08 0.22 0.01 0.01  3.1 91.8880.099 7.0
> 395
> 613  -40   NA   NA 0.11 0.04 0.35 0.04 0.03  5.7 95.7360.128 6.8
> 371
> 7 7  -36 0.25 0.34 0.04 0.01 0.36 0.01 0.01  6.3 73.2720.284 6.2
> 186
> 8NA   NA   NA   NA 0.04 0.00 0.70 0.00 0.03 14.6 85.3360.110 6.2
> 203
> 9 8  -33 0.20 0.12 0.08 0.02 0.40 0.09 0.03  3.3 79.0960.235 6.7
> 357
> 10   NA   NA   NA   NA 0.06 0.01 0.67 0.21 0.06 12.8 93.7600.075 6.3
> 220
>
> A subset of my "comm" dataset:
>
> >ind
>   NoTaxa PET SIGNAL PONSE OE50 PropAlien  avg_cover  inv_cover  nat_cover
> 27 26   23.3NA   NA19 0.07594937 0. 0.09836066
> 28 16   23.324 0.2116 0.40506329 0. 0.52459016
> 29 15   13.1NA   NANA 0.37974684 0. 0.45901639
> 30 18   23.618 0.23 0 0.40506329 0.2778 0.44262295
> 31 25   43.0NA   NANA 0.51898734 0. 0.67213115
> 32 22   03.137 0.4228 0.36708861 0. 0.47540984
> 33 15   03.0 9 0.11 0 0.30379747 0. 0.39344262
> 34 17   03.0NA   NANA 0.32911392 0. 0.39344262
> 35 16   13.037 0.4569 0.27848101 0. 0.32786885
> 36 33   43.155 0.3812 0.62025317 0.5556 0.63934426
>
> Thank you!
>
> Lauren Quinn
>
>
>
>
> _
> Hotmail: Free, trusted and rich email service.
>
>[[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.

[[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] Error in solve.default(as.matrix(fit$hessian))

2010-02-21 Thread Roman Luštrik
Dear list,

I'm trying to construct a zero-inflated negative binomial model but I get
greeted by an error. I haven't had the chance to try my dataset on different
OSs or different R version, but I did mange to try that for the "cod
parasite" data from Zuur et al book (Mixed effect models...) and I get a
similar error (models with different formulas may or may not go through,
depending on R  version and the system). This is the error I get for the cod
data.

1> nb1a <- zeroinfl(Intensity ~ Area*Year | Area*Year + Length,
dist="negbin", link="logit", data=ParasiteCod2)
Error in solve.default(as.matrix(fit$hessian)) :
  system is computationally singular: reciprocal condition number =
1.5208e-17

I get the same error on my data:

frm <- formula(st_zir ~ obs_b+sonce+mraz+nmv | obs_b+sonce+mraz+nmv)
nb <- zeroinfl(frm, dist="negbin", link="logit", data=zir2)
Error in solve.default(as.matrix(fit$hessian)) :
  system is computationally singular: reciprocal condition number =
3.87086e-25

Has anyone any idea how to solve this? It has been suggested that it's
something in my data, but I don't know what to think if the cod parasite
data shows different success/failures on different versions for the same
model.

Cheers,
Roman


-- 
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


Re: [R-sig-eco] Book Suggestions

2010-05-11 Thread Roman Luštrik
I found Zuur et al's A beginner's guide to
Rfor basics, and Kindt and Coe's
Tree
diversity 
analysis(free)
for intro into multivariate ecological analysis. There are just from
the top of my head and there are others.

Cheers,
Roman



On Tue, May 11, 2010 at 6:45 PM, Kyle Hernandez  wrote:

> Hello,
>My name is Kyle Hernandez and I'm a Ph.D. candidate at Purdue
> University.  I am an R-user and have recently just started the Purdue
> R-users Group.  However, I am really the only one in my area
> (ecology/evolution/behavior) that uses R (and has an advanced education in
> statistics). A group of fellow students really want to get into R
> (especially those doing QTL/animal model things) and requested to have a
> readings course this summer.  I will be there to help them understand the
> syntax (and the math), but I don't know of any good 'general' R books.  I
> have used Pinheiro and Bates Mixed-Effect Models in S and S-PLUS for
> personal reasons, but it really only focuses on the nlme package.  If anyone
> has a suggestion for a book that would go through data I/O, data management
> (matrices, etc.), and then goes into univariate and multivariate statistics
> (possibly even genomics) then please let me know.  I know of statmethods as
> a great resource for statistics, and I'm sure there are several other
> resources for specifics (i.e., I use the ggplot2 online websource almost
> daily).  I doubt such a book exists, but maybe through your suggestions I
> can find one book and several online resources to help these students learn
> R.  I really appreciate your help!
>
> Kyle
>
> --
> Kyle Hernandez
> Ph.D. Candidate
> Department of Biological Sciences
> Purdue University
> West Lafayette, IN 47907
>
> ___
> 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


Re: [R-sig-eco] randomization

2010-07-17 Thread Roman Luštrik
Maybe this post on block designs is what the doctor ordered?

http://www.wekaleamstudios.co.uk/posts/generating-balanced-incomplete-block-designs-bibd/

Cheers,
Roman



On Sat, Jul 17, 2010 at 9:46 PM, shylock holmes wrote:

>
> Hi all, I am totally new to R - never used it and just beginning to read
> through the websites and posted notes to learn what and how R does things.
> So for what I am planning on doing, I have no clue really, and wanted to ask
> for some advice.
>
> I have 3 insect species that I am planning on letting oviposit one egg onto
> different diets (or hosts): there are 4 types of food with 4 variants of
> each food type (i.e., original food type a, artificially created food type
> a, artificial food type a with substitute x, artificial food type a with
> substitute y, and so on for all other food types); I am also planning that
> each food type with all variants is replicated 20 times per insect species
> (in total 960 eggs with 320 eggs per insect species with 20 eggs on 16
> different food variants as above). How can I randomize the order of food
> items and what insect species lays eggs on what food type the best way by
> using R?
>
> Any suggestions are greatly appreciated!!!
>
> Many thanks
>
> _
>
>
>[[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.

[[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] Dissimilarity ranking

2010-11-23 Thread Roman Luštrik
Maybe what you're looking for is ?vegan::metaMDS

Cheers,
Roman



On Tue, Nov 23, 2010 at 9:09 PM, Pekin, Burak K  wrote:

> Hello, I want to rank the dissimilarity of sites based on their species
> composition. For example, I would like to be able to say that site A is less
> similar in composition to the other sites than site B is similar to the
> other sites. I could do a cluster analysis and look at which sites are less
> closely clustered.
>
> It would be even better if I could come up with a quantitative scale rather
> than a relative ranking that would give a value for each site based on its
> relative dissimilarity to the rest of the sites. So site A might receive a
> 90 out of 100, whereas site B and C might receive a 60 and a 50 indicating
> the rank as well as 'relative quantity' of dissimilarity for each site.
>
> Thanks,
> Burak
>
> --
>
> Burak K. Pekin, PhD
> Postdoctoral Research Associate
> Purdue University
>
>
>[[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.

[[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] relative compositional dissimilarity among sites against a continuous variable

2010-11-24 Thread Roman Luštrik
I would venture a guess that your data may not be of the correct form. Can
you show us the output of str() of your summary data.frame? As a side note,
it may be unwise to name your data objects after functions, especially like
a commonly used one as summary().


Cheers,
Roman



On Wed, Nov 24, 2010 at 11:53 PM, Pekin, Burak K  wrote:

> When I run adonis with the following code:  adonis (MamPA ~ Mam_tot,
> data=summary, method="bray", zerodist="add")
>
> I get the error message: Error in G * t(hat) : non-conformable arrays
>
> What does non-conformble arrays mean?
>
>
> -Original Message-
> From: Jari Oksanen [mailto:jari.oksa...@oulu.fi]
> Sent: Wednesday, November 24, 2010 5:43 PM
> To: Pekin, Burak K
> Cc: 'r-sig-ecology@r-project.org'
> Subject: Re: [R-sig-eco] relative compositional dissimilarity among sites
> against a continuous variable
>
> On 25/11/10 00:37 AM, "Pekin, Burak K"  wrote:
>
> > Thanks Jari, so in essence I would be doing something like a PERMANOVA.
>
> Burak,
>
> Very vaguely similar (some people would say "no, not at all"). If you want
> to do something like PERMANOVA and do it in R (instead of using Marti
> Anderson's PERMANOVA standalone software binaries in Windows), you can use
> adonis() of vegan  which does this like it should be done.
>
> Cheers, Jari Oksanen
> >
> > -Original Message-
> > From: Jari Oksanen [mailto:jari.oksa...@oulu.fi]
> > Sent: Wednesday, November 24, 2010 5:35 PM
> > To: Pekin, Burak K; 'Andy Rominger'
> > Cc: 'r-sig-ecology@r-project.org'
> > Subject: Re: [R-sig-eco] relative compositional dissimilarity among
> > sites against a continuous variable
> >
> > On 24/11/10 23:48 PM, "Pekin, Burak K"  wrote:
> >
> >> Thanks Andy, that's a simple enough calculation. So the larger the
> >> average dissimilarity, the more the site is dissimilar in its
> >> composition to other sites. I could then do a regression between the
> >> average dissimilarity of sites and other site factors and say
> >> something like 'compositional dissimilarity increases as factor X
> increases'.
> > Burak,
> >
> > If this is really what you need, remember that diagonal elements of
> > the dissimilarity matrix are zeros (dissimilarity between the object and
> itself).
> > This means that the row or column mean of the dissimilarity to
> > *other* sites is underestimated. You should either make the diagonal to
> NA:
> >
> > d <- as.matrix(vegdist(x))
> > diag(d) <- NA
> > rowMeans(d, na.rm = TRUE)
> >
> > or adjust the means for one zero element:
> >
> > d <- as.matrix(vegdist(x))
> > rowMeans(d)*(nrow(d)/(nrow(d)-1))
> >
> > This does not influence the ranks, but it doesn't hurt if your numbers
> > are correct.
> >
> >
> >>
> >> Is there a method that regresses the relative compositional
> >> dissimilarity among sites against a continuous variable?
> >>
> >
> > The mean dissimilarity is found for your observations, so it is of the
> > same length as your data vectors. You can use functions like lm(),
> > glm(), nls(),
> > gam() or some hundred other alternatives in packages to analyse the
> results.
> >
> > Cheers, Jari Oksanen
> >
> >> -Burak
> >>
> >> From: Andy Rominger [mailto:ajromin...@gmail.com]
> >> Sent: Tuesday, November 23, 2010 4:11 PM
> >> To: steve_fried...@nps.gov
> >> Cc: Pekin, Burak K; r-sig-ecology-boun...@r-project.org;
> >> r-sig-ecology@r-project.org
> >> Subject: Re: [R-sig-eco] Dissimilarity ranking
> >>
> >> or perhaps could you use something as simple as the mean
> >> dissimilarity?  i'm thinking something like this:
> >>
> >> library(vegan)
> >>
> >> ##some data to play with, 20 sites by 30 spp
> >> data(dune)
> >>
> >> ##calculate distance, making it a matrix
> >> dune.dist <- as.matrix(vegdist(dune,method=
> >> "bray"))
> >>
> >> ##take average distance
> >> dune.avg <- apply(dune.dist,1,mean)
> >> dune.avg
> >>
> >> not sure what the gurus of dissimilarity analysis might think of this.
> >> good luck,
> >> andy
> >>
> >> On Tue, Nov 23, 2010 at 5:43 PM,
> >> mailto:steve_fried...@nps.gov>> wrote:
> >> Burak
> >>
> >> You should explore the use of non-metric multidimensional scaling.
> >>
> >> ?cmdscale
> >>
> >> Steve Friedman Ph. D.
> >> Ecologist  / Spatial Statistical Analyst Everglades and Dry Tortugas
> >> National Park
> >> 950 N Krome Ave (3rd Floor)
> >> Homestead, Florida 33034
> >>
> >> steve_fried...@nps.gov
> >> Office (305) 224 - 4282
> >> Fax (305) 224 - 4147
> >>
> >>
> >>
> >> "Pekin, Burak K"
> >>  >> u>
> To
> >> Sent by:
> >> "'r-sig-ecology@r-project.org'"
> >> r-sig-ecology-bou
> >> mailto:r-sig-ecology@r-project.org>>
> >> n...@r-project.or
> >> cc
> >> g
> >>
> Subject
> >>   [R-sig-eco] Dissimilarity ranking
> >> 11/23/2010 03:09
> >> PM
> >>
> >>
> >>
> >>
> >>
> >>
> 

Re: [R-sig-eco] Converting species counts into species list

2010-12-06 Thread Roman Luštrik
http://r.789695.n4.nabble.com/Expand-a-contingency-table-based-on-the-value-in-one-column-td892111.html



On Mon, Dec 6, 2010 at 9:08 AM, Ophelia Wang wrote:

> Hello,
>
> I have a list of species and abundance that looks like this:
>
> Aegiinte3
> Agonperu  3
> Aiouimpr   2
> Albiniop2
> Albisubd   1
> ..
>
> And I need to convert these two columns into a column in which each
> cell represents an individual of a articular species:
>
> Aegiinte
> Aegiinte
> Aegiinte
> Agonperu
> Agonperu
> Agonperu
> Aiouimpr
> Aiouimpr
> Albiniop
> Albiniop
> Albisubd
> .
>
> Can someone help me to develop a script to do the conversion?
>
> Thanks a lot!
>
> Ophelia
>
> ___
> 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


Re: [R-sig-eco] Dissimilarity ranking

2010-12-10 Thread Roman Luštrik
Package vegan is your friend. See vegdist function (among others).

Cheers,
Roman




On Fri, Dec 10, 2010 at 1:28 PM, Yong Zhang <2010202...@njau.edu.cn> wrote:

>
> Hello all,
>
> If I have 15 sites with the species composition data, how should I get the
> dissimilarity matrix of those sites? Which function or package should I use?
> I am green,
>
> sorry for any inconvenience that I brought to you.
>
> Any of your hint or suggestion will be greatly appreciated.
>
> All the best.
>
>
> 2010-12-10
>
>
>
> Yong Zhang, ph.D.
> Lab of aquatic insect & stream ecology
> Dept.of Entonology, Nanjing Agricultural University
> Nanjing, China 210095
> Cell: (+86) 025-84395241
> email:2010202...@njau.edu.cn 
>
> ___
> 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


Re: [R-sig-eco] Understanding NMS (non-metric multidimensional scaling) outputs

2010-12-12 Thread Roman Luštrik
There are a few pages about NMDS theory (for a lay person) in Zuur et
al's *Analysing
ecological data* as well as some examples with R code (I would have to check
the highstats page, though). The chapter that introduces NMDS talks about
stress value, too. You can also check out Clarke & Warwicks's *Changes in
marine communities: An approach to statistical analysis and
interpretation*(PRIMER-E manual). No R code, though (but can be used
to understand NMDS,
among other methods).

Cheers,
Roman



2010/12/12 Gian Maria Niccolò Benucci 

> Hi everybody,
>
> I was wondering if exist "something" where to read about NMS outputs. In
> particular about commenting a generated NMS ordination graph.
> Thank you very very much in advance,
>
> Gian
>
>[[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.

[[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] Recommend texts to learn graphing in R?

2010-12-14 Thread Roman Luštrik
This is one potential start: http://www.statmethods.net/graphs/index.html



On Tue, Dec 14, 2010 at 7:23 PM, Raphael Mazor  wrote:

> I am looking to learn how to make simple graphs using R. Can someone
> recommend useful texts to learn the basics of graphing in R?
>
> Thanks!
>
>
> --
>
> Raphael D. Mazor
> Freshwater Biologist
> Southern California Coastal Water Research Project
> 3535 Harbor Blv Suite 110
> Costa Mesa, CA 92626
>
> Tel. (714) 755-3235
> Fax. (714) 755-3299
>
> ___
> 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] thank you

2010-12-22 Thread Roman Luštrik
Dear list,

yesterday, I have successfully defended my graduation thesis (I worked on
polychaete ecology), for which analysis was done entirely in R. This feat
could not have happened without the help of knowledgeable and
altruistic posters
to this list . THANK YOU!


Cheers,
Roman

-- 
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


Re: [R-sig-eco] extract specific data

2011-01-06 Thread Roman Luštrik
Did you have something like this in mind?

#prepare the data
traits <- data.frame(letters[1:9],
sample(letters, 9),
sample(letters, 9),
sample(letters, 9),
sample(letters, 9),
sample(letters, 9),
sample(letters, 9),
sample(letters, 9),
sample(letters, 9))
colnames(traits) <- c("species", 1:8)
comcops <- data.frame(community = paste("com", rep(1:3, each = 3), sep =
""),
species = sample(letters[1:9], 9, replace = TRUE))

> traits
  species 1 2 3 4 5 6 7 8
1   a c u j f e x w s
2   b k w w v m l d k
3   c j x q r a t a n
4   d b v o w p o c a
5   e h g g a n n r d
6   f x d b p v i p j
7   g r i m k g r l v
8   h p l n l t p m z
9   i g a l d x h z q

> comcops
  community species
1  com1   f
2  com1   c
3  com1   b
4  com2   c
5  com2   a
6  com2   h
7  com3   h
8  com3   d
9  com3   e

all(comcops$species %in% traits$species) #check

#mambo jumbo
traits[as.character(comcops$species), ]
mix.all <- apply(comcops, 1, function(x, df.traits) {
out <- df.traits[which(df.traits$species == x[2]), ]
return(out)
}, df.traits = traits)
mix.all <- do.call("rbind", mix.all)

final <- cbind(community = comcops$community, mix.all)

> split(final, final$community)
$com1
  community species 1 2 3 4 5 6 7 8
6  com1   f x d b p v i p j
3  com1   c j x q r a t a n
2  com1   b k w w v m l d k

$com2
   community species 1 2 3 4 5 6 7 8
31  com2   c j x q r a t a n
5   com2   a c u j f e x w s
8   com2   h p l n l t p m z

$com3
   community species 1 2 3 4 5 6 7 8
81  com3   h p l n l t p m z
4   com3   d b v o w p o c a
51  com3   e h g g a n n r d


To maximize your chances of getting a reply, I would suggest you provide the
list with a minimal working example of (fake) data you're working with.


Cheers,
Roman



On Thu, Jan 6, 2011 at 12:39 PM, Peter Francis  wrote:

> Dear List,
>
> I have a data frame called trait with roughly 800 species in, each species
> have 15 columns of information:
>
> Species 1   2   3   etc..
> a   t   y   h
> b   f   j   u
> c   r   y   u
>
> etc..
>
>
> I then have another data frame called com with the composition of species
> in each region, there are 506 different communities:
>
> community   species
> NA1102  a
> NA1102  c
> NA0402  b
> NA0402  c
> AT1302  a
> AT1302  b
>
> etc..
>
>
> What i want to do is extract the information held in the first data frame
> for each community and save this as a new data frame.
>
> Resulting in : -
>
> community_NA1102
>
> a   t   y   h
> c   r   y   u
>
> community_NA0402
>
> b   f   j   u
> c   r   y   u
>
> Thanks in advance for any suggestions / code.
>
> ___
> 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


Re: [R-sig-eco] Is MAFA and DFA implemented in R?

2011-01-14 Thread Roman Luštrik
This is from the highstat website on DFA (Analyzing ecological
data).
Book is from 2007 and things may have changed in between?

#DFA was programmed in FORTRAN, and is available from Brodgar
#www.brodgar.com
#To the best of our knowledge, no R code exists


Cheers,
Roman



On Fri, Jan 14, 2011 at 5:07 PM,  wrote:

> Hello,
> does anybody know, are Min/Max Autocorrelation Factor Analysis (MAFA)
> and/or Dynamic Factor Analysis (DFA) implemented in a R package?
>
> Solow, A.R. (1994). Detecting Change in the Composition of a Multispecies
> Community. Biometrics, 50, 556-565
> Zuur, A.F. et al. (2003). Estimating common trends in multivariate time
> series using dynamic factor  analysis. Environmetrics, 14(7):665-685.
>
> Thank you in advance,
> Vit
>
> --
> Vit Syrovatka
> Department of Botany and Zoology
> Masaryk University
> Kotlarska 2
> CZ-611 37 Brno, Czech Republic
>
> Tel.: +420-532146342
> E-mail: syro...@sci.muni.cz
>
> ___
> 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


Re: [R-sig-eco] Stress in metaMDS from vegam package

2011-03-10 Thread Roman Luštrik
Affirmative (about R).

Cheers,
Roman



On Thu, Mar 10, 2011 at 7:00 PM, Ronaldo Reis Junior wrote:

> Hi,
>
> I have a newbie doubt. I try to use metaMDS in R, it is OK, but the
> stress that I get is 16.32, in other programs stress is showed like
> 0.173. I don't find a good explanation about this calculations on books,
> I think that R show stress em a percentage data (0-100) and other
> software in a proportional data (0-1), it is correct?
>
> Thanks
> Ronaldo
>
> --
> 11ª lei - Você deve conhecer mais de sua dissertação do que seu
>   orientador.
>
>   --Herman, I. P. 2007. Following the law. NATURE, Vol 445, p. 228.
>
> >  Prof. Ronaldo Reis Júnior
> |  .''`. UNIMONTES/DBG/Lab. Ecologia Comportamental e Computacional
> | : :'  : Campus Universitário Prof. Darcy Ribeiro, Vila Mauricéia
> | `. `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil
> |   `- Fone: (38) 3229-8192 |ronaldo.r...@unimontes.br
> |http://www.ppgcb.unimontes.br/lecc  | LinuxUser#: 205366
>
>
>[[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.

[[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] Binning

2011-03-11 Thread Roman Luštrik
If you have access to Applied spatial data analysis with R (Bivand et al)
book, there's little something on class intervals starting on page 77. See
also classInt::classIntervals.

Cheers,
Roman



On Fri, Mar 11, 2011 at 5:45 PM, Scott Chamberlain <
scttchamberla...@gmail.com> wrote:

> Dear R ecologists,
>
>
> We are trying to figure out the correct way to decide the width and number
> of bins for our analysis.
>
> We have a meta-anlaysis in which effect sizes are collected from the
> equator to the poles. We want to run a simulation that picks a random subset
> of data points from bins along the x-axis (latitude), do a meta-analysis,
> and repeat N times. Then compare observed meta-analysis results to that of
> the simulation set of results.
>
> It seems in my reading thus far that picking bin widths and number of bins
> is largely arbitrary. Is this correct?
>
> Number of observations is very large at the temperate latitudes (30-40
> degrees) and very sparse in the tails (towards the equator and poles). We
> are using the absolute value of latitude, so there are no negative numbers.
> Is it okay to use different bin widths along the latitude axis? If so, we
> could create bins with more equitable number of data points by increasing
> the bin width from 30-40 degrees towards the equator and poles.
>
>
>
> Thanks in advance,
>
> Scott Chamberlain
> Rice University, EEB Dept.
>
>
>
>[[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.

[[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] richness estimators

2011-03-25 Thread Roman Luštrik
Hi Fernando,

your "poolaccum" class is a list. You can access each element using either
[[ or $ (object$listName). In your case, that would be estimator$jack1. If
you want the mean by rows, you can do

apply(X = estimator$jack1, MARGIN = 1, FUN = mean)

or if you want standard deviation

apply(X = estimator$jack1, MARGIN = 1, FUN = sd)

Someone more knowledgeable will have to weigh in on the ACE/ICE estimators.

Cheers,
Roman



On Fri, Mar 25, 2011 at 5:34 PM, Fernando Rodrigues da Silva <
bigos...@yahoo.com.br> wrote:

> Hello everyone,
>
> I get two questions about richness estimators ..
>
> When I use the command below poolaccum from library (vegan) I have the
> following
> result
>
> estimator <- poolaccum (est, permutations = 100, minsize = 1)
> summary (estimator, display = "jack1")
>
> N Jackknife 1   2.5%  97.5%   Std.Dev
> 1 5.21 2.000 8.525000 1.79952294
> 2 9.60 4.2125000 14.50 2.65622958
> 3 12.116667 6.667 17.508333 2.83689616
> 4 13.607500 8.500 18.25 2.86595635
> 5 14.10 9.600 18.60 2.62628516
>  6 14.751667 9.833 18.17 2.34706099
> 7 15.408571 10.7142857 18.285714 2.11297296
> 8 15.54 11.750 19.25 2.10607886
> 9 15.77 12.311 18.44 1.80268052
> 10 15.974000 12.900 18.50 1.40105444
> 11 16.198182 13.3409091 19.022727 1.36031920
> 12 16.089167 14.833 17.67 0.93069726
> 13 16.012308 14.8461538 17.692308 0.72956962
> 14 15.857143 15.8571429 15.857143 0.
>
> 1) I would like to know which command I have to use to get the mean and
> standard deviation ... What command I use to use these data as vectors
> separately ..
>
> 2) For the ACE and ICE estimators they consider the abundance of 10
> individuals
> or incidence in 10 samples as being rare, I wonder if anyone
> know how to change this value.
>
> Thank you for your attention.
>
> Best regards,
>
>
> FERNANDO RODRIGUES DA SILVA
> ===
>
> Doutor em Biologia Animal
>
> Lab. de Ecologia Animal, UNESP - São José do Rio Preto - Cep 15054-000
>
> Celular:(17) 8126-4085 & (17) 9774-3163
>
> MSN:  bigos...@hotmail.com   Skype: presidentedalaponia
>
> Lattes:
> http://buscatextual.cnpq.br/buscatextual/visualizacv.jsp?id=K4777878T8
>
> 
>
>
>
>[[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.

[[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] subsetting data in R

2011-04-24 Thread Roman Luštrik
You can also use droplevels() on your new object (as of R 2.12).

Cheers,
Roman



On Sun, Apr 24, 2011 at 3:42 PM, Christian Parker  wrote:

> You are creating a new object, but the columns that are stored as factors
> are not being 'refactored' so you are retaining the original list of levels.
> To fix this you can use the factor function after you subset
>
> pa2 = subset(pa, influencia=="AID")
> pa2$influencia<-as.factor(pa2$influencia)
>
>
>
> On Apr 24, 2011, at 6:04 AM, Manuel Spínola  wrote:
>
> > Dear list members,
> >
> > I have a question regarding too subsetting a data set in R.
> >
> > I created an object for my data:
> >
> >> pa = read.csv("espec_indic.csv", header = T, sep=",", check.names = F)
> >
> >> levels(pa$influencia)
> > [1] "AID" "AII" "AP"
> >
> > The object has 3 levels for influencia (AP, AID, AII)
> >
> > Now I subset only observations with influencia = "AID"
> >
> >> pa2 = subset(pa, influencia=="AID")
> >
> > but if I ask for the levels of influencia still show me the 3 levels,
> > AP, AID, AII.
> >
> >> levels(pa2$influencia)
> > [1] "AID" "AII" "AP"
> >
> > Why is that?
> >
> > I was thinking that I was creating a new data frame with only AID as a
> > level for influencia.
> >
> > How can I make a complete new object with only the observations for
> > "AID" and that the only level for influencia is indeed "AID"?
> >
> > 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
> > mspin...@una.ac.cr
> > mspinol...@gmail.com
> > Teléfono: (506) 2277-3598
> > Fax: (506) 2237-7036
> > Personal website: Lobito de río
> > 
> > Institutional website: ICOMVIS 
> >
> >[[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-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


Re: [R-sig-eco] Random sampling

2011-08-26 Thread Roman Luštrik
Something along the lines of

x <- 1:5
sample(x = x, size = 100, replace = TRUE, prob = x^2)


?

Cheers,
Roman



On Fri, Aug 26, 2011 at 9:50 PM, Oscar Galli  wrote:

> I have to write code to build a numeric vector with 20 elements and sample
> elements of the vector such that the probability that an item is taken to be
> proportional to the square of that value.
>
> As I estimate the probability?
>
> Cheers, Oscar
>
>
>[[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.

[[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] 3-way ANOVA with 2 repeated measures

2011-10-20 Thread Roman Luštrik
Perhaps this list is not a place to start. There's plenty of material to
read online (first), as well as dead-tree (and digital) versions of books at
your disposal. If you're a beginner, you might want to start with simple
stuff and build on that. It's not hard, it just needs some time. For general
programming stuff, http://stackoverflow.com/questions/tagged/r and for
stats, http://crossvalidated.com/ are at your disposal. Plenty of good
answers and if you can't find it, there's an army of eager people willing to
give you a hand.

Here are a few quick links:
http://cran.r-project.org/doc/manuals/R-intro.html
http://www.statmethods.net/
http://www.gardenersown.co.uk/Education/Lectures/R/index.htm

Cheers,
Roman



On Thu, Oct 20, 2011 at 2:18 PM, Renato Filogonio  wrote:

> Hello everybody,
>
> My name is Renato and I´m a begginer user of R. I´m having a problem to
> analyse my dataset, which is designed as a 3-way ANOVA with 2 repeated
> measures. I have just no idea of which package I should use and the steps I
> should follow to make my analysis, so if any of you guys could help me with
> it, I would really appreciate!
>
> Thanks in advance,
>
> Renato
>
>[[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.

[[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] help - vegan taxondive

2012-02-01 Thread Roman Luštrik
vegan comes with a few vignettes, have a look at those. You can start with
this one:
http://cran.r-project.org/web/packages/vegan/vignettes/diversity-vegan.pdf

>From the vignette:

R> data(dune)
R> data(dune.taxon)
R> taxdis <- taxa2dist(dune.taxon, varstep=TRUE)
R> mod <- taxondive(dune, taxdis)

First few lines of dune.taxon:

Genus   Family  Order   Subclass
 Class
Belper Bellis   Asteraceae  Asterales   Asterids
Dicots
Empnig   Empetrum  Empetraceae   Ericales   Asterids
Dicots
Junbuf JuncusJuncaceae   JuncalesCommelinids
Monocots
Junart JuncusJuncaceae   JuncalesCommelinids
Monocots
Airpra   Aira  Poaceae PoalesCommelinids
Monocots

Have a look at dune.taxon. I hope that gets you started.

Cheers,
Roman



2012/2/1 Gian Maria Niccolò Benucci 

> Dear Members,
>
> I would try to use indices of taxonomic diversity and distinctness to
> differentiate two mycorrhizal fungal communities. My problem is up to
> the*dis
> * object required to the function for the calculation. In the function help
> I red that "function* taxa2dist* can produce a suitable dist object from a
> classification table". How should I should create this classification
> table? How it should look-like?
> Thank you very much in advance,
>
> Gian
>
> --
> Gian Maria Niccolò Benucci, Ph.D.
> Department of Applied Biology
> University of Perugia
> Borgo XX Giugno, 74
> 06121 - Perugia, ITALY
> Tel: +390755856433
> Email: gian.benu...@gmail.com
>
>
>
> *- Do not print this email unless you really need to. Save paper and
> protect the environment! -*
>
>[[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.

[[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] SIMPER analysis

2012-03-09 Thread Roman Luštrik
Have you checked previous topics on this?
http://r-sig-ecology.471788.n2.nabble.com/template/NamlServlet.jtp?macro=search_page&node=471788&query=simper

Cheers,
Roman



2012/3/9 Gian Maria Niccolò Benucci 

> Hi members,
>
> Do anyone know if SIMPER analysis (Clarke 1993) is implemented in R?
> It is used to address which species are responsible for the differences
> between different groups.
> Thank you so much,
>
> --
> Gian *--*
>
>[[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.

[[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] CCA and related ordination techniques

2012-03-21 Thread Roman Luštrik
By a quick check of my bookshelf, I could recommend these two:

Analyzing ecological data (Zuur et al)
Numerical ecology with R (Borcard et al)

Cheers,
Roman




On Wed, Mar 21, 2012 at 1:22 PM, Marc Taylor  wrote:

> Dear R-sig-ecology group,
>
> Can anyone recommend a good reference on ordination techniques? In
> particular, I could use some clear explanations as to the
> differences/similarities between Canonical Correlation Analysis, Redundancy
> Analysis, and Canonical Correspondence Analysis. I'm hoping to explore some
> of the methods included in the vegan package but am lacking some basic
> knowledge beyond those methods offered in the program PRIMER.
>
> Cheers,
> Marc
>
>[[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.

[[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] Function "density" _barplot

2012-03-21 Thread Roman Luštrik
Here's a "hack" that seems to work for this particular situation.

test<-c(4,8,9,6,7)
barplot(test,density =20,angle=45)
barplot(test,density =20,angle=-45, add = TRUE)


Cheers,
Roman




On Wed, Mar 21, 2012 at 2:02 PM, momadou sow  wrote:

> Hi,
> I wanted crossed lines  in barplots afer the use of this code.
> >test<-c(4,8,9,6,7)
> >barplot(test,density =20,angle=45)
> Please, how to do it?
> I attached an example showing  what I want to do.
> Thank you in advance.
> Momadou
> ___
> 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


Re: [R-sig-eco] Estimating HR overlap by adehabitatHR

2012-03-27 Thread Roman Luštrik
You can use rgeos package to find overlapping areas.

Cheers,
Roman



On Tue, Mar 27, 2012 at 3:27 PM, Conrado Galdino  wrote:

> Dear all,
>
>
> I estimated the home range area of individuals from my study system by
> using MCP method - function mcp() adehabitatHR package. Now I'm in need to
> estimate overlap home ranges areas among those individuals in accordance to
> the estimated polygons, however it seems that adehabitatHR is not able to
> handle home range overlaps from  HR's given by mcp function. I see that it
> is possible to obtain such overlaps by Kernel-density method -
> kerneloverlap() - but it is not my specific intends. Is it kerneloverlap()
> the only way I have to obtain the HR overlap areas by using adehabitatHR
> package?
>
> In the wait for the experienced voices
>
> Hope that my words sounds clear,
> Sincerely,
> --
> »Conrado A. B. Galdino
> ---
>
> Programa de Pós-Graduação em Zoologia da PUC-Minas
> Av. Dom José Gaspar, 500 - Coração Eucarístico, 30535-610, Belo
> Horizonte-MG, Brasil
> Fone: (31) 3319-4407
> Currículo Lattes 
> Perfil no Google Scholar
> Citations
>
> -Baixe minhas publicações:
> -My papers for download:
> http://www.mendeley.com/profiles/conrado-galdino/publications/journal/
>
>[[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.

[[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] Automating analysis in subsamples

2012-07-18 Thread Roman Luštrik
Is this something along the lines you were looking for? What I do is split
both data.frames along the sub.sample and feed individual list elements
from both data.frames to mapply where the arguments are being used as sp
and env in your code (I swapped them for x and y).

library(vegan)
sp <- as.data.frame(matrix(sample(c(rep(0, 50), rep(1, 20), rep(2,
   10), rep(3, 10))), 30, 30))

env <- as.data.frame(matrix(c(rnorm(30, 3, 5), rnorm(30, 5, 9), rnorm(30,
20, 10), rnorm(30, 50, 20)), 30, 4))
sub.sample <- factor(c(rep("a", 10), rep("b", 10), rep("c", 10)))

thiago <- function(x, y) {
   xy <- matrix(sample(rep(1:5, 6)), 10, 2)
   pcnm1 <- pcnm(dist(xy))$vectors
   partition <- varpart(x, ~., pcnm1, data=y)
   plot(partition)
}

thiago(x = sp, y = env)

sp.split <- split(sp, sub.sample)
env.split <- split(env, sub.sample)

par(mfrow = c(1, 3))
mapply(thiago, x = sp.split, y = env.split)

HTH,
Roman


On Thu, Jul 19, 2012 at 1:56 AM, Thiago Gonçalves-Souza <
tgoncalves.so...@gmail.com> wrote:

> Dear list,
>
> I would like to run several analyses to partitioning the variance of the
> species composition matrix into spatial and environmental variables, but in
> two different scales. Firstly, I'll use the main matrix (in the example
> with 30 rows) that combines all samples (sp matrix below). The other
> matrices are env and pcnm (both with 30 rows). Then, I'd like to did the
> same again, but choosing only the subsamples (a=10 rows, b=10, c=10). Can I
> automate these steps instead of repeating the code to every subsample?
>
> sp <- as.data.frame(matrix(sample(c(rep(0, 50), rep(1, 20), rep(2,
> 10), rep(3, 10))), 30, 30))
>
> env <- as.data.frame(matrix(c(rnorm(30, 3, 5), rnorm(30, 5, 9), rnorm(30,
> 20, 10), rnorm(30, 50, 20)), 30, 4))
>
> xy <- matrix(sample(rep(1:5, 6)), 30, 2)
>
> sub.sample <- factor(c(rep("a", 10), rep("b", 10), rep("c", 10)))
>
> library(vegan)
>
> pcnm1 <- pcnm(dist(xy))$vectors
>
> partition <- varpart(sp, ~., pcnm1, data=env)
>
> plot(partition)
>
> Thank you in advance,
>
> Thiago.
>
>
> --
> Thiago Gonçalves-Souza, Ms.
> Universidade Estadual Paulista (UNESP)
> Departamento de Zoologia e Botânica
> Programa de Pós-Graduação em Biologia Animal (Doutorado)
> E-mail alternativo: thiagoara...@gmail.com
> Home page:
>
> [[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.

[[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] Workspace Question

2012-07-18 Thread Roman Luštrik
You don't say whether you resumed working in 2.14.1 from a previous session
or did you start anew?

Cheers,
Roman



On Thu, Jul 19, 2012 at 12:34 AM, Michael Trianni wrote:

> I recently installed R version 2.14.1. After a session in 2.14.1, I saved
> the 'workspace image'. I then opened earlier R versions, 2.14.0 & 2.12.0,
> and the only objects listed were from the 2.14.1 session. All the work
> under those previous versions were gone, to my dismay. This did not happen
> when I was working in 2.14.0, as 2.12.0 objects were not affected when
> saving the workspace image in 2.14.0.
>
> Are the 2.14.0 & 2.12.0 objects retrievable or permanently deleted?
> [[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.

[[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] Printing significance stars

2012-09-02 Thread Roman Luštrik
These elements are not accessible because they are "just" printed
using printCoefmat
function. This is the relevant piece of code in mentioned function that
constructs "signif.stars".

Signif <- symnum(pv, corr = FALSE, na = FALSE,
   cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),
   symbols = c("***", "**", "*", ".", " "))

You could use this function to encode the stars yourself, you would just
pass your p value(s) as pv.

Cheers,
Roman

On Sun, Sep 2, 2012 at 11:16 AM, Karen Kotschy wrote:

> Dear wonderful R people
>
> Could anyone tell me how to retrieve the significance stars from the output
> of adonis (or any other anova table)?
>
> I have written a script to run adonis and send the output to a LaTeX table
> dynamically (i.e. the table is generated as the document compiles). I can
> retrieve all the other bits I need, for example as
> adonisoutput$aov.tab$Df[1] for the first Df value, etc. But I can't figure
> out how to get the significance stars.
>
> Thanks
> Karen
>
> ---
> Karen Kotschy
> Centre for Water in the Environment
> University of the Witwatersrand, Johannesburg
> South Africa
>
> [[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.

[[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] population simulations in R

2013-01-13 Thread Roman Luštrik
You could wrap everything in replicate(..., simplify = FALSE). The result
will be in a list. You can lapply through the list, plotting whatever you
need. Here's a mock example of replicate:

replicate(5, {
  x <- matrix(rnorm(9), nrow = 3)
   },
   simplify = FALSE)


Cheers,
Roman



On Sun, Jan 13, 2013 at 12:40 PM, Peter Houk  wrote:

> Greetings all -
>
> I'm in the process of fitting some population models and had a question
> regarding the simulation process in R.  Below I've pasted a simple code for
> logistic growth with some stochasticity in the growth rate parameter ("r" -
> see the runif part of the code).  If you run continue to repeat this code
> you get a similar, but distinct and unique population model (i.e., graph of
> population versus time) each time.  What I'm figure out is how to automate
> the process to do this say...10 times...and plot all ten simulations on one
> graph.  I'm trying to use a matrix approach, and fill each element.
> However, I'm having difficulties figuring things out.
>
> I appreciate any assistance offered,
>
> Peter
>
>
> Code:
>
>
> test.logistic<-function(alpha=0.01, r0=1.2, f=0.2, N0=80, t=100) {
> r<-c(r0, numeric(t))
> for (i in 1:t) r[i+1]<- {
> runif(1,0.8,1.1)
> }
> N<-c(N0, numeric(t))
> for (k in 1:t) N[k+1]<- {
> (N[k]+r[i]*N[k]*(1-(N[k]*alpha))-f*N[k])
> }
> return(N)
> }
> Nts<-bevholt()
> t<-100
> plot(0:t, Nts, type="l")
>
>
>
>
>
> --
> Peter Houk, PhD
> Chief Biologist
> Pacific Marine Resources Institute
> www.pacmares.com
> www.micronesianfishing.com
>
> [[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.

[[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] population simulations in R

2013-01-13 Thread Roman Luštrik
Gosh, I apologize for my haste answer.

What I do when I want to run a function with different parameters is
construct a data.frame, where each row represents a unique scenario and
columns are parameter names. Then I write an anonymous function and I pass
it to apply(..., MARGIN = 1, ...). A more "exotic" (for me) way would be to
construct a list of vector parameters, then sapply or lapply through it,
just like with apply (or using sapply or lapply as a hidden for loop). By
using mapply one could pass some sort of coloring index for each scenario.

Perhaps something along the lines of

scens <- data.frame(
   alpha = seq(from = 0.01, to = 0.1, length.out = t),
   r = 1.2,
   f = seq(from = 0.001, to = 0.4, length.out = t), # changes from run to
run
   N0 = 80, # constant for all runs
   t = t)

result <- apply(scens, MARGIN = 1, FUN = function(x) {
 out <- test.logistic(alpha = x["alpha"], r = x["r"], f = x["f"], N0 =
x["N0"], t = x["t"])
 out
   })

plot(x = 0:t, y = result[[1]], type = "n") # you may need  to adjust ylim
lapply(result, FUN = function(x) {
  lines(x = 0:t, y = x)
   })


Cheers,
Roman

On Sun, Jan 13, 2013 at 2:25 PM, Duncan Golicher wrote:

> Hello Peter,
>
> It should be easy to adapt this to your needs.
>
>
> http://duncanjg.wordpress.com/2008/03/12/disturbance-and-the-lotka-volterra-competition-model/
>
> All the best,
>
> Duncan
>
> On Sun, Jan 13, 2013 at 11:40 AM, Peter Houk  wrote:
> > Greetings all -
> >
> > I'm in the process of fitting some population models and had a question
> > regarding the simulation process in R.  Below I've pasted a simple code
> for
> > logistic growth with some stochasticity in the growth rate parameter
> ("r" -
> > see the runif part of the code).  If you run continue to repeat this code
> > you get a similar, but distinct and unique population model (i.e., graph
> of
> > population versus time) each time.  What I'm figure out is how to
> automate
> > the process to do this say...10 times...and plot all ten simulations on
> one
> > graph.  I'm trying to use a matrix approach, and fill each element.
> > However, I'm having difficulties figuring things out.
> >
> > I appreciate any assistance offered,
> >
> > Peter
> >
> >
> > Code:
> >
> >
> > test.logistic<-function(alpha=0.01, r0=1.2, f=0.2, N0=80, t=100) {
> > r<-c(r0, numeric(t))
> > for (i in 1:t) r[i+1]<- {
> > runif(1,0.8,1.1)
> > }
> > N<-c(N0, numeric(t))
> > for (k in 1:t) N[k+1]<- {
> > (N[k]+r[i]*N[k]*(1-(N[k]*alpha))-f*N[k])
> > }
> > return(N)
> > }
> > Nts<-bevholt()
> > t<-100
> > plot(0:t, Nts, type="l")
> >
> >
> >
> >
> >
> > --
> > Peter Houk, PhD
> > Chief Biologist
> > Pacific Marine Resources Institute
> > www.pacmares.com
> > www.micronesianfishing.com
> >
> > [[alternative HTML version deleted]]
> >
> > ___
> > R-sig-ecology mailing list
> > R-sig-ecology@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
>
> --
> Dr Duncan Golicher
> Investigador Titular,
> El Colegio de la Frontera Sur, Chiapas,Mexico
> Mexico tel +52 1 967 137 94 20
> Skype name duncangolicher
>
> Publications: http://www.mendeley.com/profiles/duncan-golicher
>
> Senior lecturer, Bournemouth University, UK
> Centre for Conservation Ecology & Environmental Change
> School of Applied Sciences
> Christchurch House rm C218a
> Bournemouth University
> Fern Barrow
> Poole (Dorset) BH12 5BB UK
> Tel. +44 (0)1202 961682
>
> For list of publications see Researcher ID:
> http://www.researcherid.com/rid/B-4240-2009
>
> dgolic...@bournemouth.ac.uk
> dgoli...@ecosur.mx
>
> Researcher ID:
> http://www.researcherid.com/rid/B-4240-2009
>
> ___
> 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


Re: [R-sig-eco] How to remove space among columns

2013-03-26 Thread Roman Luštrik
How do you want to remove the space, so that when you print a data frame
that the columns are closer together? Pr perhaps you're trying to merge
column names into a single string? Perhaps something third? Can you expand
your answer?

Cheers,
Roman



2013/3/27 Manuel Spínola 

> Dera list members,
>
> How to remove spaces among columns in a data frame.
>
> 1 2 3 4  to become 1234
>
> 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
> mspin...@una.ac.cr
> mspinol...@gmail.com
> Teléfono: (506) 2277-3598
> Fax: (506) 2237-7036
> Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS 
>
> [[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.

[[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] How to remove space among columns

2013-03-27 Thread Roman Luštrik
Manuel, you've been provided by a few alternatives. Here's mine.

x <- read.table(text ="col1  col2 col3 col4 col5 col6
 01  1 0 ac
 10  0 0 ad
 01  1 1 bd", header = TRUE)

x$newx <- apply(x[, 1:4], 1, paste, collapse = "")
> x
  col1 col2 col3 col4 col5 col6 newx
10110ac 0110
21000ad 1000
30111bd 0111

I opted for a new column, but you can construct your data.frame anyway you want.

Cheers,
Roman


On Wed, Mar 27, 2013 at 2:32 PM, Pierre THIRIET
 wrote:
>
> Hi Manuel,
>
> try this combination of paste(), which collapse your variables into a
> single one, and cbind() for binding this new variable with the others of
> your initial data frame
>
> mat=as.data.frame(matrix(1:18,3,6))
> mat2=cbind(newV=with(mat,paste(V1,V2,V3,V4,sep="")),mat[,5:6])
>
> is it what you wanted?
>
> cheers,
> Pierre
>
> PS: this kind of questions should go into general R help list
>
> Le 27/03/2013 14:15, Manuel Spínola a écrit :
> > Thank you very much to all that answered my question, some one of you asked
> > me to be more specific, here is my question again:
> >
> > I hava a data frame:
> >
> > col1  col2 col3 col4 col5 col6
> > 01  1 0 ac
> > 10  0 0 ad
> > 01  1 1 bd
> >
> > I want to end with a data frame like this (the first 4 columns without
> > space):
> >
> > 0110 ac
> > 1000 ad
> > 0111 bd
> >
> >
> > Best,
> >
> > Manuel
> >
> >
> >
> > 2013/3/26 Roman LuĹĄtrik 
> >
> >> How do you want to remove the space, so that when you print a data frame
> >> that the columns are closer together? Pr perhaps you're trying to merge
> >> column names into a single string? Perhaps something third? Can you expand
> >> your answer?
> >>
> >> Cheers,
> >> Roman
> >>
> >>
> >>
> >> 2013/3/27 Manuel SpĂ­nola 
> >>
> >>> Dera list members,
> >>>
> >>> How to remove spaces among columns in a data frame.
> >>>
> >>> 1 2 3 4  to become 1234
> >>>
> >>> 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
> >>> mspin...@una.ac.cr
> >>> mspinol...@gmail.com
> >>> TelĂŠfono: (506) 2277-3598
> >>> Fax: (506) 2237-7036
> >>> Personal website: Lobito de rĂ­o <
> >>> https://sites.google.com/site/lobitoderio/>
> >>> Institutional website: ICOMVIS 
> >>>
> >>>  [[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.
> >>
> >
> >
> >
> >
> > ___
> > 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
>



--
In God we trust, all others bring data.

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


Re: [R-sig-eco] Any R packages equivalent to Fragstats?

2013-04-17 Thread Roman Luštrik
Is this what you're looking for?
http://r-sig-geo.2731867.n2.nabble.com/Fragstats-in-R-td5470347.html
http://cran.r-project.org/web/packages/SDMTools/SDMTools.pdf

Cheers,
Roman



On Wed, Apr 17, 2013 at 7:22 PM, Bruce Miller  wrote:
>
> Hi all,
>
> Any/*R*/ packages that include the equivalent of FRAGSTATS for
> fragmentation indices?
> Tnx
>
> Bruce
>
> [[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.

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


Re: [R-sig-eco] Any R packages equivalent to Fragstats?

2013-04-17 Thread Roman Luštrik
Another great tool for searching R related contents is the `sos` package.

library(sos)
findFn("fragstats")

returns 3 hits.

Cheers,
Roman



On Wed, Apr 17, 2013 at 7:27 PM, Sarah Goslee  wrote:
> Hi Bruce,
>
> Searching for FRAGSTATS at
> www.rseek.org
> will get you a couple of  options.
>
> Sarah
>
> On Wed, Apr 17, 2013 at 1:22 PM, Bruce Miller  wrote:
>> Hi all,
>>
>> Any/*R*/ packages that include the equivalent of FRAGSTATS for
>> fragmentation indices?
>> Tnx
>>
>> Bruce
>>
>
> --
> 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



-- 
In God we trust, all others bring data.

___
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


Re: [R-sig-eco] Welcome to the "R-sig-ecology" mailing list

2013-07-19 Thread Roman Luštrik
I'm assuming you're trying to interpret the results of a logistic
regression. If something else is your goal, please let us know.

Here's a starting page you can try:
http://www.ats.ucla.edu/stat/mult_pkg/faq/general/odds_ratio.htm
In short, logistic regression gives you the odds of something happening
against something not happening. So one level is XX times more/less likely
to happen than the other.
I also suggest you read up on validating your logistic model (like ROC plot
besides the standard checking of residuals).

Cheers,
Roman


On Sat, Jul 20, 2013 at 5:00 AM, Moshiur Rahman wrote:

> Dear R-helpers,
>
> I did an experiment with Guppy where I had two dietary groups ("High" and
> "Low"). I completed all my data analysis, but stacked in "paternity
> analysis". I ran the attached model to analyse them, but as a novice in R,
> it's very hard for me to confirm whether this gives me the correct output
> or not. I would like to examine the effect of the predictor traits (VAP,
> Viability, Body FAs) on paternity success (Proportion). Here, I fitted
> generalized linear models (GLMs) using a logit-link function as my data has
> some zeroes and ones. I also like to use quasi-GLMs to correct for
> overdispersion. Now, I need some help from you guys to estimate the
> paternity success of my high group or both groups?
>
>  With kind regards,
>
>
> On Sat, Jul 20, 2013 at 10:51 AM,  >wrote:
>
> > Welcome to the R-sig-ecology@r-project.org mailing list!
> >
> > To post to this list, send your message to:
> >
> >   r-sig-ecology@r-project.org
> >
> > General information about the mailing list is at:
> >
> >   https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >
> > If you ever want to unsubscribe or change your options (eg, switch to
> > or from digest mode, change your password, etc.), visit your
> > subscription page at:
> >
> >
> >
> https://stat.ethz.ch/mailman/options/r-sig-ecology/mrahmankufmrt%40gmail.com
> >
> >
> > You can also make such adjustments via email by sending a message to:
> >
> >   r-sig-ecology-requ...@r-project.org
> >
> > with the word `help' in the subject or body (don't include the
> > quotes), and you will get back a message with instructions.
> >
> > You must know your password to change your options (including changing
> > the password, itself) or to unsubscribe without confirmation.  It is:
> >
> >   Medhamaa07
> >
> > Normally, Mailman will remind you of your r-project.org mailing list
> > passwords once every month, although you can disable this if you
> > prefer.  This reminder will also include instructions on how to
> > unsubscribe or change your account options.  There is also a button on
> > your options page that will email your current password to you.
> >
>
>
>
> --
> MD. MOSHIUR RAHMAN
> PhD Candidate
> School of Animal Biology/Zoology (M092)
> University of Western Australia
> 35 Stirling Hwy, Crawley, WA, 6009
> Australia.
> Mob.: 061-425205507
>
> ___
> 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


Re: [R-sig-eco] Using the mra package in R...

2013-08-25 Thread Roman Luštrik
Try coercing your data to matrix. You currently have a data.frame, which
might matter to the package functions (I'm not familiar enough with the
functions to be able to tell from the top of my head).

as.matrix(my.data)

A side note, here's how you would write a model that includes all
(remaining) variables in your data:

F.cjs.estim(~ ., data = ...)

Notice the ., which means "all available".

Cheers,
Roman



On Mon, Aug 26, 2013 at 8:01 AM, Adam Fawcett wrote:

> Hi Sarah and all
>
> Thanks for those couple of tips. They did help to show that the data
> imported alright but that there was a distinct difference between my data
> set and the example data set for used to demonstrate the mra package.
>
> I have attached subset of my data as suggested. Its formatted as a
> tab-delimited text file with row names included (bird band numbers). I have
> tried importing with and without row names but this doesn't appear to make
> any difference.
>
> To import to R, I have been using the following process.
>
> brtb <- read.table (file="filepath\\brtb.txt", header = TRUE, row.names =
> 1, sep = "", colClasses="numeric")
>
> Inspecting the data using str(brtb) provides the following
>
> 'data.frame':   65 obs. of  19 variables:
>  $ C1 : num  0 0 0 0 0 0 0 0 1 1 ...
>  $ C2 : num  1 1 0 0 0 0 0 0 0 0 ...
>  $ C3 : num  1 0 1 1 1 1 1 1 0 0 ...
>  $ C4 : num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C5 : num  0 0 0 0 1 0 0 0 0 0 ...
>  $ C6 : num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C7 : num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C8 : num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C9 : num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C10: num  0 0 0 0 0 0 0 0 1 0 ...
>  $ C11: num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C12: num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C13: num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C14: num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C15: num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C16: num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C17: num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C18: num  0 0 0 0 0 0 0 0 0 0 ...
>  $ C19: num  0 0 0 0 0 0 0 0 0 0 ...
>
> The comparative example I am looking at from the mra package is the
> dipper.histories data. Inspecting this with str(dipper.histories) provides
> the following
>
>  num [1:294, 1:7] 1 1 1 1 1 1 1 1 1 1 ...
>  - attr(*, "dimnames")=List of 2
>   ..$ : chr [1:294] "1" "2" "3" "4" ...
>   ..$ : chr [1:7] "h1" "h2" "h3" "h4" ...
>
> There is an obvious difference in the returned output from the str()
> function. Inspection of both data frames shows they are formatted in a
> similar way, or at least appear to be.
>
> With respect to the function I am attempting to run in mra, I have run the
> examples routines as described in the mra manual using the supplied data.
> Results as described. In attempting this on any of my own data as attached
> I get an error message. The function I am trying to run is as follows
>
> brtb.cjs = F.cjs.estim(
> ~x2+x3+x4+x5+x6+x7+x8+x9+x10+x11+x12+x13+x14+x15+x16+x17+x18,
> ~x1+x2+x3+x4+x5+x6+x7+x8+x9+x10+x11+x12+x13+x14+x15+x16+x17, brtb)
>
>
> Each time I get the following error
>
> Error in F.cjs.estim(~x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 +
>  :
>   Capture histories must consist of 0's, 1's, and 2's only.
>
> I have checked thru the data-set to make sure the data matches these
> requirements, that there are no additional characters in the data-set, etc.
> and keep getting the same error. Have tried a different subsets of the
> data, different import options, etc. but still no success.
>
> Am assuming the error lies with the format of the data imported to R but
> cannot work out where or how to adjust to match the example.
>
> Any suggestions or advice on this one would be greatly appreciated.
>
> Cheers
>
> Adam...
>
>
> On 25 August 2013 23:33, Sarah Goslee  wrote:
>
> > Hi,
> >
> > The first thing to do is str(yourdata) to double-check that your data
> > import worked as expected. Particularly check that your data column isn't
> > actually of mode factor.
> >
> > If that doesn't give you a lead on solving the problem, posting a
> > reproducible example here with a subset of your data provided using
> dput()
> > and the actual code you used will get you concrete answers, rather than
> > random guesses.
> >
> > Sarah
> >
> >
> > On Sunday, August 25, 2013, Adam Fawcett wrote:
> >
> >> Have been trying to analyse life history data collected from a long term
> >> mark-recapture study of birds using the package mra. While the analysis
> >> works fine on the supplied example dataset, I keep getting error
> messages
> >> when running my data thru the F.cjs.estim function. Error message states
> >> that the data for this analysis must be either 1, 2 or0's. Have triple
> >> checked my data and its all 1 & 0's as required.
> >>
> >> Problems is likely to be an issue with either the read.table function to
> >> import my data (all correctly formatted and transformed ready for the
> >> analysis, possibly adding a character I have been able to remove, or
> with
> >> the mra package itself.
> >>
> >> Does anyone have experience usi

Re: [R-sig-eco] R graphics cookbook

2013-09-23 Thread Roman Luštrik
I see `area` in your data.frame, but where's `year_bis`?

Cheers,
Roman


On Mon, Sep 23, 2013 at 9:36 AM, Dylann Kersusan
wrote:

> Hi everyone,
>
> I am trying to apply the following lines of coding (they are from the R
> Graphics Cookbook, Chapter 3: Bar Graphs):
>
> ggplot(data, aes(x=year_bis,y=area)) + geom_bar(stat="identity")
>
> I do have a data.frame as follow:
>
>   id year start_day locarea
> 1  1 2010   155  20  3.4388
> 2  1 2010   169  18 11.6576
> 3  1 2010   183  17 15.5893
> 4  1 201071  41 22.0356
> 5  1 2010   127  42 27.2602
> 6  1 201099  37 52.2779
>
>
> > str(data)'data.frame':221 obs. of  5 variables:
>  $ id   : int  1 1 1 1 1 1 1 1 1 1 ...
>  $ year : int  2010 2010 2010 2010 2010 2010 2008 2010 2009 2010 ...
>  $ start_day: int  155 169 183 71 127 99 337 1 337 113 ...
>  $ loc  : int  20 18 17 41 42 37 10 36 41 40 ...
>  $ area : num  3.44 11.66 15.59 22.04 27.26 ...
>
>
> I called both packages "gcookbook" and "ggplot2" (among others). That's a
> rather easy line of coding, but for some reasons I do have the following
> warning message:
>
> Error in as.environment(x) :
>
> incorrect
>
> objet for 'as.environment'
>
>
> Do you have any clue why?
> Thanks a lot.
>
> Greetings.
> --
> Dylann Kersusan
> Master Biodiversity and Conservation
> Zoology dept. Stockholm University
> --
> Grimsö Wildlife Research Center
> Ecology dept. SLU
> Riddarhyttan-Sweden
>
> [[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.

[[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] Error message using getverticeshr() to extract home-range contours

2013-11-07 Thread Roman Luštrik
Perhaps you could show us your code. Are you using a loop?

Cheers,
Roman



On Thu, Nov 7, 2013 at 4:23 PM, Dylann Kersusan
wrote:

> Dear list,
>
> I am running a script on my computer to estimate kernelUDs for several
> individuals and several years (from GPS relocations). I am using the
> getverticeshr() function to extract home range contours, and for some
> reasons I end up having this error message:
>
> Erreur dans re[[i]] : indice hors limites
>
> in french, the english translation would be:
>
> Error in re [[i]]: index out of range
>
> --
> Dylann Kersusan
> Master Biodiversity and Conservation
> Zoology dept. Stockholm University
> --
> Grimsö Wildlife Research Center
> Ecology dept. SLU
> Riddarhyttan-Sweden
>
> [[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.

[[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] Error message using getverticeshr() to extract home-range contours

2013-11-07 Thread Roman Luštrik
Put a browser() call as the first line inside the if() {} statement and run
the chunk of code. Program will pause at the line of browser() and then you
can step through the code to see the offending line. Another way would be
to see the trace stack of traceback(), a function you run after you get an
error.

Cheers,
Roman



On Thu, Nov 7, 2013 at 4:32 PM, Dylann Kersusan
wrote:

> Sorry for the first thread, it was incomplete! There you have a sample of
> my dataset and coding.
>
> Cheers,
>
>
> 2013/11/7 Dylann Kersusan 
>
> > Dear list,
> >
> > I am running a script on my computer to estimate kernelUDs for several
> > individuals and several years (from GPS relocations). I am using the
> > getverticeshr() function to extract home range contours, and for some
> > reasons I end up having this error message:
> >
> > Erreur dans re[[i]] : indice hors limites
> >
> > in french, the english translation would be:
> >
> > Error in re [[i]]: index out of range
> >
> > Here you have a sample of my dataset:
> >
> > idnr name species sex collarID UTC_DATE Day Month Year UTC_TIME
> > UTC_DATE_TIME X Y check checkinfo HEIGHT Date_time
> > J-01129 Sivva wolverine FALSE 8277 13/01/2010 13 1 2010 20:01:48
> 13/01/2010
> > 20:01:48 1603644 7440041 0 0 763 13/01/2010 20:01:48
> > J-01129 Sivva wolverine FALSE 8277 14/01/2010 14 1 2010 02:01:21
> 14/01/2010
> > 02:01:21 1603740 7440591 0 0 676 14/01/2010 02:01:21
> > J-01129 Sivva wolverine FALSE 8277 14/01/2010 14 1 2010 11:01:47
> 14/01/2010
> > 11:01:47 1603748 7440202 0 0 801 14/01/2010 11:01:47
> > J-01129 Sivva wolverine FALSE 8277 14/01/2010 14 1 2010 20:01:09
> 14/01/2010
> > 20:01:09 1603257 7439872 0 0 799 14/01/2010 20:01:09
> > J-01129 Sivva wolverine FALSE 8277 15/01/2010 15 1 2010 02:00:23
> 15/01/2010
> > 02:00:23 1602251 7438341 0 0 1027 15/01/2010 02:00:23
> > J-01129 Sivva wolverine FALSE 8277 15/01/2010 15 1 2010 11:00:42
> 15/01/2010
> > 11:00:42 1600433 7439602 0 0 765 15/01/2010 11:00:42
> > J-01129 Sivva wolverine FALSE 8277 15/01/2010 15 1 2010 20:01:19
> 15/01/2010
> > 20:01:19 1600605 7428709 0 0 920 15/01/2010 20:01:19
> > J-01129 Sivva wolverine FALSE 8277 16/01/2010 16 1 2010 11:00:51
> 16/01/2010
> > 11:00:51 1601455 7426934 0 0 472 16/01/2010 11:00:51
> > J-01129 Sivva wolverine FALSE 8277 17/01/2010 17 1 2010 02:01:17
> 17/01/2010
> > 02:01:17 1607980 7433757 0 0 782 17/01/2010 02:01:17
> > J-01129 Sivva wolverine FALSE 8277 17/01/2010 17 1 2010 11:00:42
> 17/01/2010
> > 11:00:42 1608667 7432781 0 0 669 17/01/2010 11:00:42
> >
> > The error might come from these lines of code:
> >
> > if(n_min <= nrow(data_biweek)) {
> > data_biweek$idnr<-as.character(data_biweek$idnr)
> > ud <- kernelUD(data_biweek[,1], h="href", grid=100, extent=4)
> > h <- perc*ud[[1]]@h$h #get new h, 100% of href or else
> > ud_new1 <- kernelUD(data_biweek[,1], h=h, grid=100, extent=1)
> > kernel90_biweek <- getverticeshr(ud_new1, percent=95,
> unout="km2")
> > homerange[[paste("hr90", id, year, count_new, sep = "_")]] <-
> > kernel90_biweek
> >
> > area <- kernel90_biweek[[2]]
> >
> > info_new_bis_biweek <- c(id,year,count_new,loc,area)
> > info <- data.frame(rbind(info, info_new_bis_biweek))
> >   }
> >
> > Thanks a lot.
> >
> >
> > 2013/11/7 Dylann Kersusan 
> >
> >> Dear list,
> >>
> >> I am running a script on my computer to estimate kernelUDs for several
> >> individuals and several years (from GPS relocations). I am using the
> >> getverticeshr() function to extract home range contours, and for some
> >> reasons I end up having this error message:
> >>
> >> Erreur dans re[[i]] : indice hors limites
> >>
> >> in french, the english translation would be:
> >>
> >> Error in re [[i]]: index out of range
> >>
> >> --
> >> Dylann Kersusan
> >> Master Biodiversity and Conservation
> >> Zoology dept. Stockholm University
> >> --
> >> Grimsö Wildlife Research Center
> >> Ecology dept. SLU
> >> Riddarhyttan-Sweden
> >>
> >
> >
> >
> > --
> > Dylann Kersusan
> > Master Biodiversity and Conservation
> > Zoology dept. Stockholm University
> > --
> > Grimsö Wildlife Research Center
> > Ecology dept. SLU
> > Riddarhyttan-Sweden
> >
>
>
>
> --
> Dylann Kersusan
> Master Biodiversity and Conservation
> Zoology dept. Stockholm University
> --
> Grimsö Wildlife Research Center
> Ecology dept. SLU
> Riddarhyttan-Sweden
>
> [[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.

[[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] help

2013-12-24 Thread Roman Luštrik
Have you tried installing through the command line? For instance
install.packages("BiodiversityR")

Cheers,
Roman


On Tue, Dec 24, 2013 at 10:53 AM, Mahnaz Rabbaniha wrote:

> Dear all
>
> I have selected install package for install others , but i take this
> message
>
> Error in install.packages(NULL, .libPaths()[1L], dependencies = NA,
> type = type) :
>   no packages were specified
>
>
> what is the problem? For knowing the windows xp is the format of my
> computer.
>
> thanks all
> --
> Mahnaz Rabbaniha
> marine Ecologist, PhD
> Iranian Fisheries Research Organization (IFRO)
> P.O.Box: 14155-6116
> Tehran, IRAN
> Phone:   +98 21 44580953
> Fax:   +98 21 44580583
>
> ___
> 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


Re: [R-sig-eco] error in install packge

2014-02-22 Thread Roman Luštrik
This question is best suited for e.g. stackoverflow.com or the R-help
mailing list.
What is the command you specify? What package are you trying to install?
Are you behind the firewall? In that case, have you tried this solution (
https://sites.google.com/site/swlazlowski/Home/hardware/using-r-behind-a-firewall
)?

Cheers,
Roman




On Sat, Feb 22, 2014 at 8:02 AM, Mahnaz Rabbaniha wrote:

> Dear all
>
> for installing of new packages i select the country but i have gotten the
> error message any times:
>
>
> Warning: unable to access index for repository
> http://mirrors.softliste.de/cran/bin/windows/contrib/3.0
> Warning: unable to access index for repository
> http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.0
> Error in install.packages(NULL, .libPaths()[1L], dependencies = NA, type =
> type) :
>   no packages were specified
> In addition: Warning message:
> In open.connection(con, "r") :
>   unable to connect to 'cran.r-project.org' on port 80.
>
>
> what is the main problem?how i dissolve?
>
>
> the widows of my computer is  XP with 32 bit
>
>
> best regards
>
> mahnaz
>
> [[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.

[[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] Query related to maxent file in dismo package

2014-09-05 Thread Roman Luštrik
Do you have appropriate Java installed?

Cheers,
Roman



On Fri, Sep 5, 2014 at 4:12 PM, Rajendra Mohan panda 
wrote:

> Dear All
>
> Inspite of putting maxent.jar file in "dismo" package/ java folder, maxent
> is showing unavailable to run the model. I would highly appreciate for your
> kind response.
>
>
>
> With best Regards
> Rajendra M Panda
> School of Water Resources
> Indian Institute of Technology Kharagpur
>
> [[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.

[[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] Query related to maxent file in dismo package

2014-09-05 Thread Roman Luštrik
Well there you go. Follow the instruction in `?maxent` and put the
appropriate .jar file into the /java folder.

Cheers,
Roman


On Fri, Sep 5, 2014 at 4:48 PM, Rajendra Mohan panda 
wrote:

> Dear Lustrik
>
> Thanks for your quick response. For your kind information maxent runs well
> in my PC without any trouble directly but shows following error in R
> me <- maxent(predictors, occtrain)
> Error in .getMeVersion() : file missing:
> C:/Program Files/R/R-3.1.1/library/dismo/java/maxent.jar.
> Please download it here: http://www.cs.princeton.edu/~schapire/maxent/
> In addition: Warning message:
> In .local(x, p, ...) :
>   2 (0.31%) of the presence points have NA predictor values
>
>
> With best Regards
> Rajendra M Panda
> SWR, IIT KGP
>
>
> On Fri, Sep 5, 2014 at 8:13 PM, Rajendra Mohan panda <
> rmp.iit@gmail.com>
> wrote:
>
> > Dear All
> >
> > I have my java installed to my PC. Maxent downloaded from official site.
> > maxent.jar file in java folder of "dismo". Still if I check for maxent
> run,
> > it shows nonavailability to run the model. Kindly advise.
> >
> > Your kind response is highly appreciated.
> >
> > With best Regards
> > Rajendra M Panda
> > SWR, IIT Kharagpur, India
> >
> >
> > -- Forwarded message --
> > From: Rajendra Mohan panda 
> > Date: Fri, Sep 5, 2014 at 8:03 PM
> > Subject: Re: [R-sig-eco] Query related to maxent file in dismo package
> > To: Roman Luštrik 
> >
> >
> > Dear Lustrik
> >
> > I didn't get it. Kindly clarify which java you mean?
> >
> > Cheers
> > RMP
> >
> >
> >
> >
> >
> >
> > On Fri, Sep 5, 2014 at 7:45 PM, Roman Luštrik 
> > wrote:
> >
> >> Do you have appropriate Java installed?
> >>
> >> Cheers,
> >> Roman
> >>
> >>
> >>
> >> On Fri, Sep 5, 2014 at 4:12 PM, Rajendra Mohan panda <
> >> rmp.iit@gmail.com> wrote:
> >>
> >>> Dear All
> >>>
> >>> Inspite of putting maxent.jar file in "dismo" package/ java folder,
> >>> maxent
> >>> is showing unavailable to run the model. I would highly appreciate for
> >>> your
> >>> kind response.
> >>>
> >>>
> >>>
> >>> With best Regards
> >>> Rajendra M Panda
> >>> School of Water Resources
> >>> Indian Institute of Technology Kharagpur
> >>>
> >>> [[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.
> >>
> >
> >
> >
>
> [[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.

[[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] Query related to maxent file in dismo package

2014-09-08 Thread Roman Luštrik
I solved my problem by installing Java JRE/JDK (link
<http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html>),
not "just" Java <https://java.com/en/download/index.jsp>.


On Tue, Sep 9, 2014 at 6:12 AM, Rajendra Mohan panda 
wrote:

> Dear All
>
> I am grateful to you for your response to my queries related to maxent. I
> succeeded to install rJava in 32bit R (not able to install in 64bit R).
> Still maxent jar file is not executing.
> My operating system is 64 bit.
> Kindly advise what necessary corrections I should take keeping my 64 bit
> operating system intact.
> Shall I install 32 bit Java for 32bit R with operating system 64bit.
> I would try but what are technical problems I do not know.
> I have various options available to me by using 32bit computers of my lab
> also. Each time I fail to execute maxent jar file.
> I would appreciate your kind response.
>
> Thanking you
>
> With best Regards
> Rajendra M Panda
> School of Water Resources
> Indian Institute of Technology Kharagpur
>
> On Mon, Sep 8, 2014 at 7:50 PM, Francisco Rodriguez Sanchez <
> f.rodriguez.s...@gmail.com> wrote:
>
> > Dear Rajendra,
> >
> > Are you running the 64-bit version of R? In that case I think you will
> > need to install the 64-bit version of Java as well, or alternatively
> switch
> > to the 32-bit version of R to run these analyses (that is what I did
> when I
> > had this same problem).
> >
> > Try loading rJava (and dismo) with the 32-bit R version - does it work?
> >
> > Hope it helps,
> >
> > Paco
> >
> >
> > El 05/09/2014 18:00, Rajendra Mohan panda escribió:
> >
> >  Dear All
> >>
> >> As you know from my trail mail, my maxent is not executing in r (working
> >> well directly).
> >> I think there is some java configuration problem what I see from the
> >> following errors after using some online available codes in
> StackOverflow
> >> site. Your kind advise is highly appreciated for how can I solve these
> >> errors?
> >> I have 64 bit PC operating system and rJava successfully installed.
> >> utils:::menuInstallLocal()
> >> package ‘rJava’ successfully unpacked and MD5 sums checked
> >>
> >>  library(rJava)
> >>>
> >> Error : .onLoad failed in loadNamespace() for 'rJava', details:
> >>call: fun(libname, pkgname)
> >>error: No CurrentVersion entry in Software/JavaSoft registry! Try
> >> re-installing Java and make sure R and Java have matching architectures.
> >> Error: package or namespace load failed for ‘rJava’
> >>
> >>  Sys.getenv("JAVA_HOME")
> >>>
> >> [1] ""
> >>
> >>> if (Sys.getenv("JAVA_HOME")!="")
> >>>
> >> +   Sys.setenv(JAVA_HOME="")
> >>
> >>> library(rJava)
> >>>
> >> Error : .onLoad failed in loadNamespace() for 'rJava', details:
> >>call: fun(libname, pkgname)
> >>error: No CurrentVersion entry in Software/JavaSoft registry! Try
> >> re-installing Java and make sure R and Java have matching architectures.
> >> Error: package or namespace load failed for ‘rJava’
> >>
> >>> Sys.setenv(JAVA_HOME="C:\\Program Files\\Java\\jre7\\")
> >>> options(java.home="C:\\Program Files\\Java\\jre7\\")
> >>> library(rJava)
> >>>
> >> Error : .onLoad failed in loadNamespace() for 'rJava', details:
> >>call: inDL(x, as.logical(local), as.logical(now), ...)
> >>error: unable to load shared object 'C:/Program
> >> Files/R/R-3.1.1/library/rJava/libs/x64/rJava.dll':
> >>LoadLibrary failure:  The specified module could not be found.
> >>
> >> Error: package or namespace load failed for ‘rJava’
> >>
> >>
> >>
> >> With best Regards
> >> Rajendra M Panda
> >> SWR, IIT KGP
> >>
> >>
> >> On Fri, Sep 5, 2014 at 8:23 PM, Roman Luštrik 
> >> wrote:
> >>
> >>  Well there you go. Follow the instruction in `?maxent` and put the
> >>> appropriate .jar file into the /java folder.
> >>>
> >>> Cheers,
> >>> Roman
> >>>
> >>>
> >>> On Fri, Sep 5, 2014 at 4:48 PM, Rajendra Mohan panda <
> >>> rmp.iit@gmail.com> wrote:
> >>>
> >>>  Dear Lustrik
> >>>>
> >>>

Re: [R-sig-eco] Query related to maxent file in dismo package

2014-09-11 Thread Roman Luštrik
On Wed, Sep 10, 2014 at 5:40 PM, Rajendra Mohan panda  wrote:

> Dear Roman
>
> In species_sample predictions.csv in the output result and in the
> train/test column I donot find any test data related information what I
> usually get in taking separate test and training datasets in direct maxent
> run. And also in ROC and Omission curve there is no test related
> information. This makes me surprise that I am right or not?
>

Unfortunately I'm not following about which tests you want. Perhaps someone
more knowledgeable can chip in?


>
> At the same time I would request you to advise on taking background value
> in following command.
> bg <- randomPoints(predictors, 500)
> What is the basis of selecting this number?
>

`randomPoints` samples 500 cells from predictors variable (RasterStack?).


> A lots of appreciation to those who have guided me to this level especially
> Roman
>
>
> With best Regards
> Rajendra M Panda
> School of Water Resources
> Indian Institute of Technology Kharagpur
>

HTH,
Roman



>
> On Wed, Sep 10, 2014 at 7:46 PM, Roman Luštrik 
> wrote:
>
> > What you get is a warning, not an error.
> > I'm afraid I don't understand your second part of the question.
> >
> > Cheers,
> > Roman
> >
> >
> > On Wed, Sep 10, 2014 at 3:50 PM, Rajendra Mohan panda <
> > rmp.iit@gmail.com> wrote:
> >
> >>  Dear Lustrik
> >>
> >> It is possible to run maxent in 64 bit operrating system with 64 bit R
> >> only
> >> after downloading Java from the link you provided.
> >> However I get following error (same for both the operating systems)
> >>
> >> me <- maxent(predictors, occtrain)
> >> Warning message:
> >> In .local(x, p, ...) :
> >>   1 (0.16%) of the presence points have NA predictor values
> >>
> >> I get output here by using predict function but no information on test
> >> gain
> >> is there. The column showing zero values.
> >> Am I wrong anywhere or this happens in "dismo" package.
> >> Kindly advise.
> >>
> >>
> >> With best Regards
> >> Rajendra M Panda
> >> IIT Kharagpur
> >>
> >> On Tue, Sep 9, 2014 at 10:53 PM, Rajendra Mohan panda <
> >> rmp.iit@gmail.com
> >> > wrote:
> >>
> >> > Dear All
> >> >
> >> > I am very much thankful to all who have responded to my queries and
> also
> >> > to the forum. My special thanks to Li and Lustrik for the patience to
> >> guide
> >> > me.
> >> > I am at the same time happy to inform you all that I could
> successfully
> >> > run maxent in 32 bit R and 32bit operating system with proper Java
> >> > installation.
> >> >
> >> >
> >> >
> >> > With best Regards
> >> > Rajendra M Panda
> >> > School of Water Resources
> >> > IIT Kharagpur
> >> >
> >> > On Tue, Sep 9, 2014 at 11:48 AM, Roman Luštrik <
> roman.lust...@gmail.com
> >> >
> >> > wrote:
> >> >
> >> >> I solved my problem by installing Java JRE/JDK (link
> >> >> <
> >>
> http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
> >> >),
> >> >> not "just" Java <https://java.com/en/download/index.jsp>.
> >>
> >> >>
> >> >>
> >> >> On Tue, Sep 9, 2014 at 6:12 AM, Rajendra Mohan panda <
> >> >> rmp.iit@gmail.com> wrote:
> >> >>
> >> >>> Dear All
> >> >>>
> >> >>> I am grateful to you for your response to my queries related to
> >> maxent. I
> >> >>> succeeded to install rJava in 32bit R (not able to install in 64bit
> >> R).
> >> >>> Still maxent jar file is not executing.
> >> >>> My operating system is 64 bit.
> >> >>> Kindly advise what necessary corrections I should take keeping my 64
> >> bit
> >> >>> operating system intact.
> >> >>> Shall I install 32 bit Java for 32bit R with operating system 64bit.
> >> >>> I would try but what are technical problems I do not know.
> >> >>> I have various options available to me by using 32bit computers of
> my
> >> lab
> >> >>> also. Each time I fail to execute maxent jar file.
> >> >>> I would appreciate

Re: [R-sig-eco] Regression with few observations per factor level

2014-10-20 Thread Roman Luštrik
I think you can, but the confidence intervals will be rather large due to
number of samples.

Notice how standard errors change for sample size (per group) from 4 to 30.

> pg <- 4 # pg = per group
> my.df <- data.frame(var = c(rnorm(pg, mean = 3), rnorm(pg, mean = 1),
rnorm(pg, mean = 11), rnorm(pg, mean = 30)),
+ trt = rep(c("trt1", "trt2", "trt3", "trt4"), each =
pg),
+ cov = runif(pg*4)) # 4 groups
> summary(lm(var ~ trt + cov, data = my.df))

Call:
lm(formula = var ~ trt + cov, data = my.df)

Residuals:
 Min   1Q   Median   3Q  Max
-1.63861 -0.46080  0.03332  0.66380  1.27974

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)   1.2345 1.0218   1.2080.252
trttrt2  -0.7759 0.8667  -0.8950.390
trttrt3   7.8503 0.8308   9.449  1.3e-06 ***
trttrt4  28.2685 0.9050  31.236  4.3e-12 ***
cov   1.4027 1.1639   1.2050.253
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.154 on 11 degrees of freedom
Multiple R-squared:  0.9932, Adjusted R-squared:  0.9908
F-statistic: 404.4 on 4 and 11 DF,  p-value: 7.467e-12

>
> pg <- 30 # pg = per group
> my.df <- data.frame(var = c(rnorm(pg, mean = 3), rnorm(pg, mean = 1),
rnorm(pg, mean = 11), rnorm(pg, mean = 30)),
+ trt = rep(c("trt1", "trt2", "trt3", "trt4"), each =
pg),
+ cov = runif(pg*4)) # 4 groups
> summary(lm(var ~ trt + cov, data = my.df))

Call:
lm(formula = var ~ trt + cov, data = my.df)

Residuals:
Min  1Q  Median  3Q Max
-2.5778 -0.6584 -0.0185  0.6423  3.2077

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)  2.769610.25232  10.977  < 2e-16 ***
trttrt2 -1.754900.28546  -6.148 1.17e-08 ***
trttrt3  8.405210.28251  29.752  < 2e-16 ***
trttrt4 27.040950.28286  95.599  < 2e-16 ***
cov  0.051290.32523   0.1580.875
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.094 on 115 degrees of freedom
Multiple R-squared:  0.9913, Adjusted R-squared:  0.991
F-statistic:  3269 on 4 and 115 DF,  p-value: < 2.2e-16

On Mon, Oct 20, 2014 at 10:53 AM, V. Coudrain  wrote:

> 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.

[[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] gis

2014-11-08 Thread Roman Luštrik
The data (.csv) is not in your working directory. Either set it to reflect
the location of the data set or specify full path.
For instance, if the file is in c:/gis/, you should either:

setwd("c:/gis")
samps <- read.table(...)

or

samps <- read.table("c:/gis/data.csv", ...)

Cheers,
Roman


On Sat, Nov 8, 2014 at 9:58 AM, Mahnaz Rabbaniha 
wrote:

> Dear all
>
> in using of GIS  codes after the install the packages and add the
>  (FieldSamples.csv):
>
>
> *samps <- read.csv("FieldSamples.csv") *
>
>   I revised this message:
>
>
> Error in file(file, "rt") : cannot open the connection
> In addition: Warning message:
> In file(file, "rt") :
>   cannot open file 'FieldSamples.csv': No such file or directory
>
> what is meaning, could you please help me to dissolve?
>
> all the best
> Mahnaz
>
> [[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.

[[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] Help in code for fitting a growth model in R

2014-11-16 Thread Roman Luštrik
There is no file attached. If you're using R, consider using an .R script
with comments (or better yet, a Rmd/Rnw with all the relevant data) and
desired result. Make sure your example is reproducible.

Cheers,
Roman

On Sun, Nov 16, 2014 at 11:04 AM, Chandrasekhar Rudrappa <
chandr...@gmail.com> wrote:

> I have to fit a model to growth data of Hevea (rubber) trees. The details
> are outlined in the attached docx file.  Kind help is solicited.
>
> --
> Dr. TR Chandrasekhar, M.Sc., M. Tech., Ph. D.,
> Sr. Scientist
> Rubber Research Institute of India
> Hevea Breeding Sub Station
> Kadaba - 574 221
> DK Dt., Karnataka
> Phone-Land: 08251-214336
> Mobile: 9448780118
>
> ___
> 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


Re: [R-sig-eco] model selection with truncated poisson distribution

2015-01-06 Thread Roman Luštrik
What kind of model selection are we talking about? The dredging part (a la
step()) or a more fine tuned, such as information-theoretic approach
advocated by (among others) Burnham and Anderson?

I would suggest the latter. Pardon me if I'm presuming too much, but in a
nutshell, this approach advocates formulating a set of plausible
hypotheses, constructing models to reflect them, and then compare based on
some criterion (like AIC). You can also use model averaging (using weights)
to get a better sense of model estimates.

Cheers,
Roman

On Tue, Jan 6, 2015 at 12:52 PM, James Rodger  wrote:

> Hi,
>
> Can anyone advise me on model selection in glm with a  zero truncated
> poisson distribution?
>
> I have used a the command vglm in the vgam package to analyse the data with
> pospoisson specified as the family and I have evaluated alternative models
> with a log-likelihood test. I am not  sure if that the test statistic will
> follow the chi-squared distribution, however.
>
> My data is on seeds per fruit (minimum 1) in different experimental
> treatments and different densities of plants.
>
> Regards,
>
> James
>
> [[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.

[[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] Beginner's to R and gstat package

2015-02-05 Thread Roman Luštrik
I would probably try to understand gstat vignettes, helping myself with web
resources like Introduction to R (
http://cran.r-project.org/doc/manuals/r-release/R-intro.html). Searching
the web can also bear fruit. If you prefer hard copies, there's R for
dummies (de Vries, Meys), The R Book (Crawley), ASDAR (Pebesma et al.
http://www.asdar-book.org/) and many more.

Cheers,
Roman

On Thu, Feb 5, 2015 at 1:51 PM, Uzzal  wrote:

> Hello,My research field is Air quality Modeling. I am new in this field.
> My professor asked me to learn gstat package in R. But I have very little
> knowledge about R and Geostatistics.
> >From Internet I found a manual on gstat package of R named "gstat user's
> manual" by Pabesma but I don't understand this manual properly .
>
> My main query is what should be the appropriate steps to learn gstat
> package for me? I have only very little basic knowledge about R .Could you
> please help me out by giving me some tips with study materials?
> Thank you in advance. Pardon me if my email seems inappropriate.
>
> Uzzal
>
>
>
> Uzzal Kumar Dash
> Master's studentAir Quality & Climate Modeling Laboratory
> (AqCliMB)School of Environmental Science and Engineering (SESE)Gwangju
> Institute of Science and Technology (GIST)123 Cheomdan-gwagiro, Buk-gu,
> Gwangju 500-712
> Republic of KoreaE-mail :  href="mailto:uz...@gist.ac.kr/uzzal.civilengineer...@gmail.com";
> jQuery1411706373835="574">
> uz...@gist.ac.kr/uzzal.civilengineer...@gmail.com
> skype Id:d.uzzal
> Facebook Name: Uzzal Orpheus
> ___
> 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


Re: [R-sig-eco] Plot NMDS with size of the points related to abundance

2015-03-17 Thread Roman Luštrik
Assuming you're working with metaMDS from vegan, it's trivial to extract
NMDS scores, add some variable and plot the data. The following code would
be easy to translate into a generic function.

library(vegan)

data(dune)
sol <- metaMDS(dune)

# add some variable that will correspond to size of points
spc <- as.data.frame(cbind(sol$species, mysize = runif(nrow(sol$species
pts <- as.data.frame(sol$points)

library(ggplot2)

ggplot(spc, aes(x = MDS1, y = MDS2)) +
  theme_bw() +
  geom_point(aes(size = mysize), pch = 1) +
  geom_point(data = pts, color = "red")


Cheers,
Roman


On Tue, Mar 17, 2015 at 4:23 PM, Barbara Baraibar Padro 
wrote:

> Hello list,
> I am analyzing species composition of weeds in 12 cover crop treatments
> and a fallow plot. I have been using nmds and got good results and no
> problems with it (although after some fighting!). My data is a matrix of
> biomass values sorted by species. Now I'd like to know which of my species
> are contributing with more biomass to the community in each treatment, that
> is, I'd like to create a graph such as the one that you get from the option
> "plot (nmds_model,  type="t", display=c("species")) but instead of getting
> just the names of the species, I'd like to see dots of different sizes that
> would refer to the abundance of each of the species, is that possible at
> all? I know you can do it with CANOCO but wanted to ask if there is a way
> to do it in R.
>
> I have searched the internet and found something that looks like what I
> want to do (enclosed to the mail) but haven't found the way to do it.
>
> I have already done an Indicator Species Analysis with the multipatt
> function. That gives me information about the species that are related to
> some treatments but here I'm just looking for the species with more and
> less biomass in each treatment.
>
> Thank you very much!!
> Barbara
>
>
>
> --
> Barbara Baraibar
> Post-doctoral scholar - Weed and Applied Plant Ecology
> Plant Sciences Department
> Penn State University
> University Park, Pennsylvania 16802
>
> web-site:http://www.weedecologypsu.com
>
> ___
> 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


Re: [R-sig-eco] Plot NMDS with size of the points related to abundance

2015-03-17 Thread Roman Luštrik
After clicking send I remembered that you might want to scale circle sizes
according to their area, not radius (which is the default to draw). Then I
went to see the link Sarah posted and it deals with this, too (great minds
think alike? :) ).

Cheers,
Roman

On Tue, Mar 17, 2015 at 4:39 PM, Roman Luštrik 
wrote:

> Assuming you're working with metaMDS from vegan, it's trivial to extract
> NMDS scores, add some variable and plot the data. The following code would
> be easy to translate into a generic function.
>
> library(vegan)
>
> data(dune)
> sol <- metaMDS(dune)
>
> # add some variable that will correspond to size of points
> spc <- as.data.frame(cbind(sol$species, mysize = runif(nrow(sol$species
> pts <- as.data.frame(sol$points)
>
> library(ggplot2)
>
> ggplot(spc, aes(x = MDS1, y = MDS2)) +
>   theme_bw() +
>   geom_point(aes(size = mysize), pch = 1) +
>   geom_point(data = pts, color = "red")
>
>
> Cheers,
> Roman
>
>
> On Tue, Mar 17, 2015 at 4:23 PM, Barbara Baraibar Padro 
> wrote:
>
>> Hello list,
>> I am analyzing species composition of weeds in 12 cover crop treatments
>> and a fallow plot. I have been using nmds and got good results and no
>> problems with it (although after some fighting!). My data is a matrix of
>> biomass values sorted by species. Now I'd like to know which of my species
>> are contributing with more biomass to the community in each treatment, that
>> is, I'd like to create a graph such as the one that you get from the option
>> "plot (nmds_model,  type="t", display=c("species")) but instead of getting
>> just the names of the species, I'd like to see dots of different sizes that
>> would refer to the abundance of each of the species, is that possible at
>> all? I know you can do it with CANOCO but wanted to ask if there is a way
>> to do it in R.
>>
>> I have searched the internet and found something that looks like what I
>> want to do (enclosed to the mail) but haven't found the way to do it.
>>
>> I have already done an Indicator Species Analysis with the multipatt
>> function. That gives me information about the species that are related to
>> some treatments but here I'm just looking for the species with more and
>> less biomass in each treatment.
>>
>> Thank you very much!!
>> Barbara
>>
>>
>>
>> --
>> Barbara Baraibar
>> Post-doctoral scholar - Weed and Applied Plant Ecology
>> Plant Sciences Department
>> Penn State University
>> University Park, Pennsylvania 16802
>>
>> web-site:http://www.weedecologypsu.com
>>
>> ___
>> 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.
>



-- 
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

Re: [R-sig-eco] Change ggplot legend

2015-04-16 Thread Roman Luštrik
Can you provide a reproducible example (using some available dataset or
simulate some data) and perhaps mark on the picture what you want to have
changed?

Cheers,
Roman


On Thu, Apr 16, 2015 at 11:11 AM, Luis Fernando García  wrote:

> Dear R experts,
>
> I am trying to make a new plot. I have already finished and I just want to
> change the color for the axis number and the legends, I have tried to make
> the last function by removing the legend and adding a new one but it did
> not work.
>
> If any of you knows how to correct this, I would really appreciate it. My
> aim is to rename the series as "Sp1" and "Sp2".
>
> Thanks in advance!
>
> HEre is the plot code
>
> p <- ggplot(t,aes(x=Ratio,y=Time)) + geom_point(aes(shape=factor(Sp)))
>
> p + geom_smooth(aes(linetype=factor(Sp), ),colour="black", method='lm',
> se=F)+theme(panel.grid.major = element_blank(), panel.grid.minor =
> element_blank(),panel.background = element_blank(), axis.line =
> element_line(colour = "black"))+
>
> theme(legend.position="none")+#Remove legend to add a new one
>
> scale_shape_discrete(name  ="Species",labels=c("Sp1", "Sp2"))
>
> [[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.

[[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] Change ggplot legend

2015-04-16 Thread Roman Luštrik
To change the axis text color, use theme().

Compare

library(ggplot2)
ggplot(PlantGrowth, aes(x=group, y=weight)) +
  geom_boxplot()

to

ggplot(PlantGrowth, aes(x=group, y=weight)) +
  geom_boxplot() +
  theme(axis.text = element_text(color = "black"))

To change legend title, see
http://www.cookbook-r.com/Graphs/Legends_(ggplot2)/#modifying-the-text-of-legend-titles-and-labels

Cheers,
Roman



On Thu, Apr 16, 2015 at 11:36 AM, Luis Fernando García  wrote:

> Sure!
>
> I can provide a sample graph
>
> I want to get the axis values to be black and remove the legend with the
> name "factor(Sp)" and get the values for the axis to be black!
>
> Thanks!
>
>
> This is the code
>
> t<-read.table ("covartimesfinal2.txt", header=T)
> attach(t)
> p <- ggplot(t,aes(x=Ratio,y=Time)) + geom_point(aes(shape=factor(Sp)))
> p + geom_smooth(aes(linetype=factor(Sp), ),colour="black", method='lm',
> se=F)+theme(panel.grid.major = element_blank(), panel.grid.minor =
> element_blank(),panel.background = element_blank(), axis.line =
> element_line(colour = "black"))+
> scale_shape_discrete(name  ="Species",labels=c("Sp1", "Sp2"))
>
> 2015-04-16 6:26 GMT-03:00 Roman Luštrik :
>
>> Can you provide a reproducible example (using some available dataset or
>> simulate some data) and perhaps mark on the picture what you want to have
>> changed?
>>
>> Cheers,
>> Roman
>>
>>
>> On Thu, Apr 16, 2015 at 11:11 AM, Luis Fernando García <
>> luysgar...@gmail.com> wrote:
>>
>>> Dear R experts,
>>>
>>> I am trying to make a new plot. I have already finished and I just want
>>> to
>>> change the color for the axis number and the legends, I have tried to
>>> make
>>> the last function by removing the legend and adding a new one but it did
>>> not work.
>>>
>>> If any of you knows how to correct this, I would really appreciate it. My
>>> aim is to rename the series as "Sp1" and "Sp2".
>>>
>>> Thanks in advance!
>>>
>>> HEre is the plot code
>>>
>>> p <- ggplot(t,aes(x=Ratio,y=Time)) + geom_point(aes(shape=factor(Sp)))
>>>
>>> p + geom_smooth(aes(linetype=factor(Sp), ),colour="black", method='lm',
>>> se=F)+theme(panel.grid.major = element_blank(), panel.grid.minor =
>>> element_blank(),panel.background = element_blank(), axis.line =
>>> element_line(colour = "black"))+
>>>
>>> theme(legend.position="none")+#Remove legend to add a new one
>>>
>>> scale_shape_discrete(name  ="Species",labels=c("Sp1", "Sp2"))
>>>
>>> [[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.
>>
>
>


-- 
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

Re: [R-sig-eco] Error in x[[1]] : subscript out of bounds

2015-04-21 Thread Roman Luštrik
Please show us folder structure and the code you're using to stack the
files. I think command `tree` can be handy for this and works on windows
and linux (I read).

Cheers,
Roman

On Mon, Apr 20, 2015 at 4:10 PM, Rajendra Mohan panda  wrote:

> Dear Roman
>
> The problem is not with the path.
> I tried separate code for each variables; and stacking works well
> myEx = raster::stack(system.file("SAJBEnv/bio01.asc",package="dismo"),
>system.file("SAJBEnv/bio02.asc",package="dismo"))
> However, I am still in doubt why the other way it does not works
> (previously it worked with lower version V 3.1.1)
> I am using upgraded versions now.
>
>
>
>
> With best Regards
> Rajendra M Panda
> SWR, IIT KGP
>
> On Mon, Apr 20, 2015 at 4:08 PM, romunov  wrote:
>
> > Is it possible that the path is wrong? Can you provide more information
> > about the path?
> >
> > Cheers,
> > Roman
> >
> >
> > On Sunday, April 19, 2015, Rajendra Mohan panda 
> > wrote:
> >
> >> Dear All
> >>
> >> If I run
> >> fnames <- stack(list.files(path=paste(system.file(package="dismo"),
> "/ex",
> >> sep=""),pattern = "grd", full.names=TRUE))
> >> It works fine.
> >> While I change my folder name to anything else with the same path, it
> >> gives
> >> following error:
> >> Error in x[[1]] : subscript out of bounds
> >> Kindly advise how it can be sorted out.
> >>
> >> Look forward to your kind response
> >>
> >> With Best Regards
> >> Rajendra M Panda
> >> School of Water Resources
> >> Indian Institute of Technology Kharagpur
> >> ___
> >> 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
>



-- 
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


Re: [R-sig-eco] Compare 4 comunity by similarity index

2015-05-28 Thread Roman Luštrik
Upon a cursory look, it looks like a Poisson regression problem to me
("ANOVA") - if you want to compare sites using quantity as explanatory
variables. If you decide to go this way, have a look at `glm(..., family =
"poisson")` function.

Cheers,
Roman

On Fri, May 29, 2015 at 12:13 AM, Marcelo  wrote:

> Hello,
>
> I have four communities (site) in my project, like this:
>
> site  specie  quantity
> 1   A   100
> 1   B 1
> 1   C23
> 1   D56
> 2   A 0
> 2   B   110
> 2   C 3
> 2   D 6
> 3   A10
> 3   B 1
> 3   C 2
> 3   D 1
> 4   A 2
> 4   B 1
> 4   C 3
> 4   D 0
>
> How I could compare this four communities? I had calculated Shannon H'
> index, but it is only intra community, not to compare inter communities. I
> have read about quantitative Czekanowski index, but, it compare only two
> communities.
>
> Please, what I could calculate from my data to compare they?
>
> Thank you very much.
>
> Marcelo
>
> ___
> 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


Re: [R-sig-eco] boxplot

2015-11-24 Thread Roman Luštrik
Hi,

I will venture a guess that your `month` variable is a factor. If true, you
will have to change the order of levels.

http://stackoverflow.com/questions/18413756/re-ordering-factor-levels-in-data-frame

Cheers,
Roman

On Tue, Nov 24, 2015 at 5:51 PM, Mahnaz Rabbaniha 
wrote:

> Dear all,
>
> maybe my question is very simple and basically.please accept my apologize.
>
> for coding of box plot i send this order on my data with two column: month
> (May-09,.Dec-10) and temperature.
>
> boxplot(Temprature~month)
>
> but in plot the X shown Dec-10 to the May-09, it is just convert.what is
> problem and how can revise it.
>
> so thanks
> mahnaz
>
> [[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.

[[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] Morisita horn similarity index

2015-11-27 Thread Roman Luštrik
Hi,

`vegdist` function of vegan package
 implements
the morisita index. Is this what you're looking for?

Cheers,
Roman


On Fri, Nov 27, 2015 at 4:55 AM, moses selebatso 
wrote:

>  Hello
> I am trying to analyse diet overlap (level of similarity) between two
> species. I have diet composition in %. I have tried to find the best tool,
> and thought Morisita horn will do, but I cant find the right package for.
> Is this the best tool?
> Thank you,
> Moses
> [[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.

[[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] NMDS axes scores

2016-01-11 Thread Roman Luštrik
Thank you Jari for an, as always, insightful email. It has been a gut
feeling of mine for quite some time that using PCA scores as independent
variables is at least little wrong but never found any reference to
substantiate it. I would like to use this opportunity to ask you or other
readers if there are any (critical) references available regarding this
usage of PCA scores?

Cheers,
Roman

On Mon, Jan 11, 2016 at 11:11 AM, Jari Oksanen  wrote:

> Contrary to common misbelief, NMDS ordination space is **metric**. In
> vegan, the ordination space (= the ordination result) is even guaranteed to
> be Euclidean (in isoMDS it can be Minkowski, but this is not allowed with
> vegan). What is non-metric is the regression from observed dissimilarities
> to the Euclidean distances in ordination space. The reason why we do not
> recommend using NMDS axes as independent beasts is that NMDS tries to
> preserve the *distances* among points. Any orthogonal rotation (= turning
> of ordination space) will change scores along rotated axes, but retain the
> distances among points. The vegan NMDS result is rotated to principal
> components, but still you should avoid thinking that this makes dimensions
> independent from each other, although the first maximizes the dispersion of
> points and axes are orthogonal (non-correlated).
>
> PCA ordination is Euclidean in the same way as NMDS. The difference to
> NMDS are that (1) only Euclidean distances among sampling units can be used
> in PCA (in NMDS you can use any adequate dissimilarity), and (2) the
> mapping is linear (instead of non-metric) from observed dissimilarities to
> Euclidean dissimilarities. Try function stressplot() in vegan to see what
> this means — it is available both for NMDS and rda (PCA) results.  CA is
> similar to PCA except that it is based on weighted Euclidean distances. I
> won’t go into mathematical details, but you can see ?wcmdscale in vegan to
> see how to get CA as a weighted Euclidean ordination of Chi-square
> transformed data.
>
> PCA and CA have some ordering criteria for their axis and therefore some
> people have used axes from those as independent beasts. I think this is
> dubious, too, but people do it all the time. The PCA/CA also define a
> multivariate space, and taking only one axis as an independent object
> sounds strange, in particular if you take something else than the first
> axes.
>
> So what to do with NMDS axes? If you take all NMDS axes and their
> interactions in a regression of type ~ axis1 + axis2 + axis1:axis2 then
> this is equal to fitting a linear trend surface, and the interaction term
> axis1:axis2 takes care that the result is invariant under rotation of NMDS
> space. Function ordisurf() in vegan gives further ideas how to fit surfaces
> to NMDS *space* (instead of simple axis). Also, if you think that some
> direction in NMDS (not necessarily parallel to the axes) is good and you
> have an indicator variable for that, you can use MDSrotate() function in
> vegan to rotate your solution to that direction and then take that rotated
> axis as your explanatory variable.
>
> HTH, Jari Oksanen
>
> > On 11 Jan 2016, at 10:38 am, Martin Weiser 
> wrote:
> >
> > Hi Conny,
> >
> > AFAIK NMDS is *non-metric* and represents distances among objects, not
> > gradients along axes (known or unknown): distances along axes are
> > stretched as needed locally (NMDS works with rank order), even order of
> > the elements along axes does not tell anything. NMDS is great if you
> > want to say: Object A resembles object C more than it resembles object
> > B, even though C and B are quite similar.
> > Try this: run NMDS several times, aim for different number of axes (e.g.
> > 1,2,3,5,10) and note the scores of the objects along the first one.  You
> > *may* get the same thing.
> >
> > If you need scores of the objects in the ordination, use something with
> > well defined metrics and axes, e.g. PCA, CA.
> >
> > HTH,
> > Martin
> >
> > On 9.1.2016 05:41, Conny wrote:
> >> Hi all,
> >>
> >>
> >>
> >> it has been frequently pointed out in this group, that NMDS axes scores
> >> shouldn't be used individually for further analysis.
> >>
> >> I therefore would like to include both of my NMDS site scores as a
> response
> >> into a GLM model simultaneously.  Unfortunately, I couldn't find any
> advice
> >> on how to actually do this. I found a  couple of papers using NMDS
> scores in
> >> GLMs, but they all seem to use them individually, fitting separate
> models to
> >> each of the ordination axes.
> >>
> >>
> >>
> >> I'm a bit at a loss here and any advice is very much appreciated,
> >>
> >> Conny
> >>
> >>
> >>  [[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řírod

Re: [R-sig-eco] Plotting power graph for one sample proportion test

2016-03-19 Thread Roman Luštrik
Hi,

you're looking for a simulation approach of sorts. What I would do is set
up a data.frame of all combination of parameters (with e.g. `expand.grid`)
you're interested in and use for example `apply` to go through each
combination and calculate power. You save that as a new variable and plot
it.

If you can provide us with parameters and their ranges perhaps we can be of
further service.

Cheers,
Roman

On Wed, Mar 16, 2016 at 10:47 PM, Kristen Gorman  wrote:

> Dear all,
> I am looking for help in plotting a power analysis using library(pwr).
> Specifically, I am using the following test:
>
> pwr.p.test ()
>
> I would like to produce a sample size vs power plot for varying alpha
> levels and differences between the null proportion and alternative
> proportion.
>
> Thanks for any guidance,
> Kristen Gorman
>
>
>
> [[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.

[[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] xlsx load

2016-09-21 Thread Roman Luštrik
Hi,

have you tried the `readxl` (
https://cran.r-project.org/web/packages/readxl/index.html) package? In my
experience, it works quite well with no Java dependencies.

Cheers,
Roman

On Wed, Sep 21, 2016 at 1:02 PM, Mahnaz Rabbaniha 
wrote:

> Dear all
>
> I want to load the xlsx package and ,the R version is 3.3.1 (2016-06-21) .
> but i cant and have taken this message:
>
> > local({pkg <- select.list(sort(.packages(all.available =
> TRUE)),graphics=TRUE)
> + if(nchar(pkg)) library(pkg, character.only=TRUE)})
> Loading required package: rJava
> Error : .onLoad failed in loadNamespace() for 'rJava', details:
>   call: fun(libname, pkgname)
>   error: JAVA_HOME cannot be determined from the Registry
> Error: package ‘rJava’ could not be loaded
>
>
> > local({pkg <- select.list(sort(.packages(all.available =
> TRUE)),graphics=TRUE)
> + if(nchar(pkg)) library(pkg, character.only=TRUE)})
> Error : .onLoad failed in loadNamespace() for 'rJava', details:
>   call: fun(libname, pkgname)
>   error: JAVA_HOME cannot be determined from the Registry
> Error: package or namespace load failed for ‘rJava
>
>
> please help me
>
> *Mahnaz *
>
> [[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.

[[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] unequal sampling effort with the use of different sampling equipment

2016-09-28 Thread Roman Luštrik
This smells like a job for a mixed effects model. You could try lme4, for
example.

Cheers,
Roman

On Wed, Sep 28, 2016 at 11:13 PM, Belyaeva Anna 
wrote:

> Dear all,
>
> I have a question about unequal sampling effort with the use of different
> sampling equipment.
> Before I got involved in this project, its sampling design was determined
> and has unequal sampling effort (different number of samples) with the use
> of sampling equipment, which has different sampling area. 35 sediment
> samples were taken from each lake: 25 samples from the profundal zone and 5
> samples from each sublittoral and littoral zones. The corer was used to
> take profundal samples (16.61 cm2). PONAR was used to take sublittoral and
> littoral samples (sampling area of 231.04 cm2). I want to analyze if the
> number of sediment types differs between lake zones. What is the way to
> account for differences in sampling procedures? Is it appropriate to
> conduct regression of residuals or multiple regression on this data?
>
> Sincerely,
> Anna
>
>
>
>
>
>
>
> [[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.

[[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] clustsig::simprof returns 'Error: argument "undef.zero" is missing with no default (FIXED DATA)

2017-02-10 Thread Roman Luštrik
Sorry to be of no help here (restrained for time), but could it be that
because `undef.zero` is not defined explicitly
, the
argument  doesn't get passed on?
Try checking out the repository, explicitly define the argument and run the
analysis. You can use devtools to speed up the development cycle.

Cheers,
Roman

On Fri, Feb 10, 2017 at 9:54 AM, Cesar, Chris P <
chris.ce...@environment-agency.gov.uk> wrote:

> Part 2: Apologies, some copy/paste gremlins took over my previous post.
> Attempt 2 at posting my data/code
>
> Apologies for taking up your screens.
>
> Best regards,
>
> Chris
>
> #
>  IMPORT DATA {Apologies, it's very messy...}
>
> df <-
>   structure(
> list(
>   Abratenu = c(
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 19.5943297127603,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 19.5943297127603
>   ),
>   Austmode = c(
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 137.160307989322,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0
>   ),
>   Capitell = c(
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 58.7829891382809,
> 0,
> 78.3773188510412,
> 0,
> 0,
> 0,
> 19.5943297127603,
> 0,
> 0,
> 0,
> 0,
> 58.7829891382808
>   ),
>   Cerstdrm = c(
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 19.5943297127603
>   ),
>   Ceraedul = c(
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 19.5943297127603,
> 901.339166786972,
> 0,
> 58.7829891382808,
> 0,
> 0,
> 0,
> 0,
> 0,
> 7994.4865228062,
> 0,
> 0,
> 0,
> 0,
> 5231.68603330699
>   ),
>   Copepoda = c(
> 0,
> 0,
> 19.5943297127603,
> 0,
> 0,
> 0,
> 19.5943297127603,
> 0,
> 0,
> 19.5943297127603,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 607.424221095569,
> 0,
> 0,
> 19.5943297127603,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0
>   ),
>   Cumogood = c(
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 19.5943297127603,
> 0,
> 0,
> 0,
> 0,
> 0,
> 39.1886594255206,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0
>   ),
>   Eteolong = c(
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 19.5943297127603,
> 0,
> 0,
> 0,
> 0,
> 0,
> 19.5943297127603,
> 58.7829891382809
>   ),
>   Hausaren = c(
> 0,
> 0,
> 19.5943297127603,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 19.5943297127603,
> 0,
> 0,
> 0,
> 0,
> 78.3773188510412,
> 0,
> 39.1886594255206,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 19.5943297127603,
> 0
>   ),
>   Laniconc = c(
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 0,
> 195.943297127603,
>

Re: [R-sig-eco] How to compare 2 independent estimates in R

2017-05-26 Thread Roman Luštrik
You want this.

https://stats.stackexchange.com/questions/30394/how-to-perform-two-sample-t-tests-in-r-by-inputting-sample-statistics-rather-tha

Cheers,
Roman

On Fri, May 26, 2017 at 7:30 PM, Manuel Spínola 
wrote:

> Dear list members,
>
> How can I compare 2 independent estimates in R?
>
> For example, I want to compare a mean that I obtained in my study with a
> mean that was obtained in another study (2 independent studies).
>
> My estimate: 2.3, EE = 0.73
>
> The other estimate: 3.4, EE = 0.97
>
> I want to obtain the effect size (the difference between estimates) with
> the 95% confidence limits.
>
> Is there any package that allow me to do that?
>
> 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
> mspin...@una.cr 
> mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río  site/lobitoderio/>
> Institutional website: ICOMVIS 
>
> [[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.

[[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 curves in ggplot

2018-12-17 Thread Roman Luštrik
I don't think it's that critical. It's just a matter of coercing the data
into a long format. And loading the entire tidyverse isn't really necessary
since we need one package from that bundle. I present a bonus feature using
plotly (see at the bottom).

library(vegan)
library(ggplot2)
library(plotly)

data(BCI)
out <- rarecurve(BCI, step = 10, sample = 400, label = FALSE)
names(out) <- paste("species", 1:50, sep = "")

# Coerce data into "long" form.
protox <- mapply(FUN = function(x, y) {
  mydf <- as.data.frame(x)
  colnames(mydf) <- "value"
  mydf$species <- y
  mydf$subsample <- attr(x, "Subsample")
  mydf
}, x = out, y = as.list(names(out)), SIMPLIFY = FALSE)

xy <- do.call(rbind, protox)
rownames(xy) <- NULL  # pretty

# Plot.
ggplot(xy, aes(x = subsample, y = value, color = species)) +
  theme_bw() +
  scale_color_discrete(guide = FALSE) +  # turn legend on or off
  geom_line()

Since exploring this mikado of lines can be hard, we can make the plot
interactive. Try hovering over the lines. Presto!

ggplotly(
  ggplot(xy, aes(x = subsample, y = value, color = species)) +
theme_bw() +
theme(legend.position = "none") +  # ggplotly doesn't respect scales?
geom_line()
)

Cheers,
Roman

On Mon, Dec 17, 2018 at 6:58 PM Drew Tyre  wrote:

> Hi Ellen,
>
> I was curious about this because I will be using a lot of vegan functions
> in a spring class. Turns out not to be trivial - as with all ggplot
> problems the trick is to get the data into a dataframe. I tried several
> things, but ended up writing my own function:
>
> # rarefraction curves and ggplot
> library("tidyverse")
> library("vegan")
> data(BCI)
> out <- rarecurve(BCI, step = 10, sample = 400)
> names(out) <- 1:50
>
> as_tibble_rc <- function(x){
>   # convert rarecurve() output to data.frame
>   # bind_rows doesn't work because items are different lengths
>   # also need to extract sample sizes from attribute
>   # Allocate result dataframe
>   nsamples <- map_int(x, length)
>   total_samples <- sum(nsamples)
>   if(!is.null(names(x))){
> sites <- names(x)
>   } else {
> sites <- as.character(1:length(nsamples))
>   }
>   result <- data_frame(Site = rep("", total_samples),
>Sample_size = rep(0, total_samples),
>Species = rep(0, total_samples))
>   start <- 1
>   for (i in 1:length(nsamples)){
> result[start:(start + nsamples[i]-1), "Site"] <- sites[i]
> result[start:(start + nsamples[i]-1), "Sample_size"] <- attr(x[[i]],
> "Subsample")
> result[start:(start + nsamples[i]-1), "Species"] <- x[[i]]
> start <- start + nsamples[i]
>   }
>   result
> }
>
> out <- as_tibble_rc(out)
> # add grouping variable
> sitedata <- data_frame(Site = as.character(1:50),
>Type = sample(LETTERS[1:2], 50, replace = TRUE))
> alldata <- left_join(out, sitedata, by = "Site")
>
> # and then it's trivial
> ggplot(data = alldata,
>mapping = aes(x = Sample_size, y = Species, color = Type, group =
> Site)) +
>   geom_line()
>
> hope that helps.
> --
> Drew Tyre
>
> School of Natural Resources
> University of Nebraska-Lincoln
> 416 Hardin Hall, East Campus
> 3310 Holdrege Street
> Lincoln, NE 68583-0974
>
> phone: +1 402 472 4054
> fax: +1 402 472 2946
> email: aty...@unl.edu
> http://snr.unl.edu/tyre
> http://drewtyre.rbind.io
> The point is that our true nature is not some ideal that we have to
> live up to. It’s who we are right now, and that’s what we can make friends
> with and celebrate.
> Excerpted from: Awakening Loving-Kindness by Pema Chödrön
>
>
> On 12/17/18, 10:14 AM, "R-sig-ecology on behalf of Ellen Pape" <
> r-sig-ecology-boun...@r-project.org on behalf of ellen.p...@gmail.com>
> wrote:
>
> Hi all,
>
> As I use ggplot2 for all my graphs, I would like to use ggplot2 to
> construct rarefaction curves as well (I also want to combine 2
> rarefaction
> curves in 1 plot using cowplot which also vows for using ggplot2).
>
> I made these rarefaction curves using the rarecurve function in vegan,
> but
> I don't see how I can use these results and put these in ggplot2.
>
> I found the following website during my search:
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.fromthebottomoftheheap.net_2015_04_16_drawing-2Drarefaction-2Dcurves-2Dwith-2Dcustom-2Dcolours_&d=DwICAg&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=aLEaSryyUcERVqcKVZl7lQ&m=ScKzUcnIZJ2da4_YAAzmizwFy-CbI90_F4SV_FKSLLc&s=-DiwE4s5JljqtJk5ZhKOE4Benr3yDXmDM19K7wNG3bI&e=
> but it does not explain how to draw rarefaction curves with ggplot2.
>
> This website mentions - and this is what I would like to be able to do
> in
> ggplot2:
>
> "Where I do think this sort of approach might work is if the samples
> in the
> data set come from a few different groups and we want to colour the
> curves
> by group.
>
> col <- c("darkred", "forestgreen", "hotpink", "blue")set.seed(3)grp <-
> factor(sample(seq_along(col), nrow(BCI2), re

Re: [R-sig-eco] Problem in generate random samples in r

2019-02-20 Thread Roman Luštrik
My guess would be that absences_15 doesn't have 1 rows. Can you
confirm or refute this?

Cheers,
Roman

On Wed, Feb 20, 2019 at 12:20 PM Lara Silva 
wrote:

> Hello,
>
> I am trying to generate random samples from the following code
>
> ### Setting random seed to always create the same
> ### Random set of points
> set.seed(0)
>
> absences_15000<-absences[sample(nrow(absences), 15000),]
> points(absences_15000, cex=0.1)
>
> ## Subsample_1
> set.seed(0)
>
> absences_1<-absences_15000[sample(nrow(absences_15000), 1),]
> dim(absences_1)
>
> I get the following error:
>
> Error in sample.int(length(x), size, replace, prob) :
>   cannot take a sample larger than the population when 'replace = FALSE'
>
> Any advice?
>
> Regards,
>
> Lara
>
> [[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.

[[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] Queries on regression analysis

2019-08-08 Thread Roman Luštrik
The assumption of linear regression is that residuals follow a normal
distribution. Fit a GLM and check the diagnostics plot.

Cheers,
Roman

On Thu, Aug 8, 2019 at 1:16 PM Chitra Baniya  wrote:

> We have the data of "gall_diameter" and "elevations". Our objective is to
> see how does gall diameter vary along the elevation gradient. In our case
> the elevation gradient refers to the range between 1500 to 2500 m asl with
> data collected in every 250 m interval.
> Our data did not follow normal distribution. Gall_diameter is a continuous
> dependent variable. Can we apply "glm" to see the relationship between
> gall-diameter and elevation in our case?
> How can we decide the distribution in our data and its family?
> Thank you all in advance for your help.
>
>
> --
>
>
>
>
>
>
> *Chitra Bahadur Baniya, M Sc, M Phil, PhDAssociate ProfessorCentral
> Department of BotanyTribhuvan UniversityKirtipurKathmandu, Nepal*
> orcid.org/-0002-8746-7601
>
> [[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.

[[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] Ecological datasets for teaching statistics

2020-06-18 Thread Roman Luštrik
I slacked off a bit, but three datasets from Zuur's book can be found in
AED package.

https://github.com/romunov/AED

Cheers,
Roman

On Thu, Jun 18, 2020 at 8:11 PM Manuel Spínola  wrote:

> Thank you very much Tom.
>
> Manuel
>
> El jue., 18 jun. 2020 a las 12:05, Philippi, Tom ()
> escribió:
>
> > Many ecological journals either encourage or require that the dataset
> > behind a paper be submitted to a repository such as dryad, or included as
> > an electronic appendix.  Even if your university does not have
> > institutional subscription to all journals, some journals like Ecosphere
> > are open-access, many journals allow authors to pay to make their papers
> > open-access, and some journals with paywall papers allow free access to
> the
> > abstract and the supplements including datasets or links to the datasets
> in
> > repositories.  That has an advantage of letting you work from a topic or
> > form of data for your teaching to find suitable datasets.  Also, those
> > datasets tend to be cleaned and documented and close to ready for the
> > analyses, as they were used in the analyses in the publications.
> >
> > The rdryad package from rOpenSci (on CRAN) has the ability to search
> > dryad, but I suspect that search works better with ecological keywords
> than
> > statistical ones.
> >
> > Tom
> >
> > -Original Message-
> > From: R-sig-ecology  On Behalf Of
> > Rich Shepard
> > Sent: Thursday, June 18, 2020 10:38 AM
> > To: r-sig-ecology@r-project.org
> > Subject: [EXTERNAL] Re: [R-sig-eco] Ecological datasets for teaching
> > statistics
> >
> > On Thu, 18 Jun 2020, Manuel Spínola wrote:
> >
> > > I teach statistics to students in ecology and environmental sciences
> > > fields and I would like to know if you could point me in the right
> > > direction of sources of ecological/environmental datasets within and
> > > outside packages, especially for general/generalized linear models and
> > > multivariate statistics.
> >
> > Manuel,
> >
> > Ecology, and it's applied focus Environmental science, are very broad.
> > I've been working with these data for several decades so I need to ask
> what
> > types of data you want.
> >
> > I don't know what's available from Costa Rican agencies but I do know
> that
> > in the US you can get geochemical, biological, hydrologidal, and other
> data
> > from the US Geological Survay, Environmental Protection Agency (if
> they've
> > not removed them), Department of Agriculture's Forest Service and Natural
> > Resources Conservation Service.
> >
> > You can also look at StreamNet run by the Pacific States Marine Fisheries
> > Council, The Army Corps of Engineers for hydraulic, flow, and sediment
> > transport data.
> >
> > That's a start.
> >
> > Rich
> >
> > ___
> > R-sig-ecology mailing list
> > R-sig-ecology@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspin...@una.cr 
> mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS 
>
> [[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.

[[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] Ecological datasets for teaching statistics

2020-06-18 Thread Roman Luštrik
Your question is likely to get lost in the debris. Try posting it as a new
topic.

Cheers,
Roman

On Fri, Jun 19, 2020 at 7:40 AM Kanfra, Xorla 
wrote:

> Dear All,
> Sorry to use this thread for communication. I subscribed to this forum
> just a few days ago but couldn’t manage to communicate across the board.
> Please pardon me. If any of you can help me get around a statistical
> challenge
> I have just started using manyglm to analyze nematode with associated
> microbial community data and I am really happy with how robust the
> algorithm works. I have a question about the adjusted p- values. I run a
> pairwise comparison for one of my factors but the p-values generated were
> all the same for each pair of comparison. Is this output normal? besides,
> are the p-values adjusted when running the pairwise comparison? Which
> method does it use? ex Tukey, FDR, Holm, BH, etc. I am a bit confused as I
> do not understand really what is going on behind the scripts.
> Below is the script I used.
> Thanks and hoping to hear from you soon
> Xorla Kanfra
>
> mod_pairwise <-anova.manyglm(otutable.glm, nBoot=199, cor.type = "I", test
> = "LR", p.uni="adjusted",pairwise.comp = ~envdata$soil)
>
> Analysis of Deviance Table
>
> Model: manyglm(formula = otutable.fv, family = "negative.binomial")
>
> Multivariate test:
>   Res.Df Df.diff   Dev Pr(>Dev)
> (Intercept)   88
> envdata$soil  81   7 429680.005 **
> envdata$response  80   1  48240.005 **
> envdata$soil:envdata$response 73   7 160660.005 **
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Pairwise comparison results:
>Observed statistic Free Stepdown
> Adjusted P-Value
> envdata$soil:H vs envdata$soil:HH6945
> 0.005 **
> envdata$soil:E vs envdata$soil:HH6881
> 0.005 **
> envdata$soil:HH vs envdata$soil:R6471
> 0.005 **
> envdata$soil:HH vs envdata$soil:M6458
> 0.005 **
> envdata$soil:E vs envdata$soil:EE6301
> 0.005 **
> envdata$soil:HH vs envdata$soil:K6032
> 0.005 **
> envdata$soil:R vs envdata$soil:RR5993
> 0.005 **
> envdata$soil:EE vs envdata$soil:RR   5855
> 0.005 **
> envdata$soil:EE vs envdata$soil:M5835
> 0.005 **
>
>
>
> -Original Message-
> From: R-sig-ecology [mailto:r-sig-ecology-boun...@r-project.org] On
> Behalf Of Thierry Onkelinx
> Sent: Thursday, June 18, 2020 9:07 PM
> To: Manuel Spínola
> Cc: r-sig-ecology@r-project.org
> Subject: Re: [R-sig-eco] Ecological datasets for teaching statistics
>
> Dear Manuel,
>
> Our institute has published 54 datasets under an open data licence at GBIF
> (
>
> https://www.gbif.org/dataset/search?publishing_org=1cd669d0-80ea-11de-a9d0-f1765f95f18b
> )
>
> You can look for local data on GBIF too.
>
> Best regards,
>
> ir. Thierry Onkelinx
> Statisticus / Statistician
>
> Vlaamse Overheid / Government of Flanders
> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
> FOREST
> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
> thierry.onkel...@inbo.be
> Havenlaan 88 bus 73, 1000 Brussel
> www.inbo.be
>
>
> ///
> 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
> The plural of anecdote is not data. ~ Roger Brinner
> The combination of some data and an aching desire for an answer does not
> ensure that a reasonable answer can be extracted from a given body of data.
> ~ John Tukey
>
> ///
>
> 
>
>
> Op do 18 jun. 2020 om 19:58 schreef Manuel Spínola :
>
> > Thank you very much Rich.
> >
> > Yes, you are right, is a very broad spectrum.
> >
> > I teach mainly to wildlife ecology students.
> >
> > I was using several datasets from different sources for homeworks and
> > final projects, but some of the students were "sharing" the results of
> the
> > assignments so I decided to assign different datasets to each student for
> > their homeworks.  This means that I need several datasets for each
> > assignment, and the data need to be similar in the structure, for
> example,
> > logistic regression, the response variable needs to be binary, and so on.
> >
> > Manuel
> >
> >
> >
> > El jue., 18 jun. 2020 a las 11:41, Rich Shepard (<
> rshep...@appl-ecosys.com
> > >)
> > escribió:
> >
> > > On Thu, 18 Jun 2020, Manuel Spínola wrote:
> > >
> > > > I teach statistics to students in ecology and environmental sciences
> > > > fields and I would like to know if you could point me in th