Dear all,
as far as I know, functions specpool and estimateR (both in package
vegan) provide only the final values of the non-parametric estimators.
In contrast to that, EstimateS calculates a real curve of each
estimator function. To me this is of importance to evaluate the
stability and reliability of the final value calculated by the
respective estimator.
Carsten Dormann found a way to achieve this in R and provided this
function for me:
> reps=100
> sequence.abies.myk<-1:nrow(abies.myk.com) #abies.myk.com is my
species-samples matrix from mycorrhizal fungi of Abies alba
> res.abies.myk<-matrix(ncol=9, nrow=length(sequence.abies.myk))
> colnames(res.abies.myk)<-names(est.abies.myk) #est.abies.myk is the
result from specpool(abies.myk.com)
> for (i in sequence.abies.myk)
{
sample.raw.abies.myk <- replicate(reps,
specpool(abies.myk.com[sample(x=1:nrow(abies.myk.com), size=i),]),
simplify=TRUE)
subsample.abies.myk <- matrix(unlist(sample.raw.abies.myk),
nrow=9, ncol=reps)
rownames(subsample.abies.myk) <- names(sample.raw.abies.myk)
res.abies.myk[i, ] <- rowMeans(subsample.abies.myk)
}
It works fine. For small data sets and many replications, curves
shapes are in concordance with the EstimateS output. For larger data
however, calculations with high values of "reps" would take hours to
days. If you use small values for "reps" instead the curves will
appear jagged and are often not publishable.
Does any one know of alternatives to display estimator curves in R?
Thanks
Martin
__________
Dr. Martin Unterseher
Universit?t Greifswald
Institut f?r Botanik und Landschafts?kologie
Lehrstuhl f?r Allgemeine und Spezielle Botanik
Grimmer Str. 88
17487 Greifswald
Tel. 03834 / 864184
Fax. 03834 / 864114
http://www.botanik.uni-greifswald.de/100.html
http://dgfm-ev.de/index.php?id=munterseher
Displaying estimators from specpool or estimateR
4 messages · Martin Unterseher, Jari Oksanen
Martin, I have supposed that functions poolaccum() and estaccumR() do this. If they are not suitable for your needs, please tell me what you want to achieve. These two functions have been in vegan since release 1.15-4 (7 September, 2009). Cheers, Jari Oksanen
On Tue, 2011-01-18 at 09:22 +0100, Martin Unterseher wrote:
Dear all, as far as I know, functions specpool and estimateR (both in package vegan) provide only the final values of the non-parametric estimators. In contrast to that, EstimateS calculates a real curve of each estimator function. To me this is of importance to evaluate the stability and reliability of the final value calculated by the respective estimator. Carsten Dormann found a way to achieve this in R and provided this function for me:
> reps=100 > sequence.abies.myk<-1:nrow(abies.myk.com) #abies.myk.com is my
species-samples matrix from mycorrhizal fungi of Abies alba
> res.abies.myk<-matrix(ncol=9, nrow=length(sequence.abies.myk)) > colnames(res.abies.myk)<-names(est.abies.myk) #est.abies.myk is the
result from specpool(abies.myk.com)
> for (i in sequence.abies.myk)
{
sample.raw.abies.myk <- replicate(reps,
specpool(abies.myk.com[sample(x=1:nrow(abies.myk.com), size=i),]),
simplify=TRUE)
subsample.abies.myk <- matrix(unlist(sample.raw.abies.myk),
nrow=9, ncol=reps)
rownames(subsample.abies.myk) <- names(sample.raw.abies.myk)
res.abies.myk[i, ] <- rowMeans(subsample.abies.myk)
}
It works fine. For small data sets and many replications, curves
shapes are in concordance with the EstimateS output. For larger data
however, calculations with high values of "reps" would take hours to
days. If you use small values for "reps" instead the curves will
appear jagged and are often not publishable.
Does any one know of alternatives to display estimator curves in R?
Thanks
Martin
__________
Dr. Martin Unterseher
Universit?t Greifswald
Institut f?r Botanik und Landschafts?kologie
Lehrstuhl f?r Allgemeine und Spezielle Botanik
Grimmer Str. 88
17487 Greifswald
Tel. 03834 / 864184
Fax. 03834 / 864114
http://www.botanik.uni-greifswald.de/100.html
http://dgfm-ev.de/index.php?id=munterseher
_______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
2 days later
Dear Jari,
thank you for your help. The plots are fine and really valuable.
However, when I tried to generate a Sweave-based file, all plot()
commands following poolaccum() (e.g.
\begin{figure}
<<fig=true>>
pool.data<-poolaccum(data)
plot(pool.data)
@
\end{figure}
resulted in empty or corrupted pdf files. I solved this problem by
manually saving the poolaccum- plots as pdf and including them in the
resulting .tex file. Some time-consuming handwork, but ok. So there is
no urgent need for response.
Best wishes
Martin
On 19 Jan 2011, at 08:58, Jari Oksanen wrote:
Martin, I have supposed that functions poolaccum() and estaccumR() do this. If they are not suitable for your needs, please tell me what you want to achieve. These two functions have been in vegan since release 1.15-4 (7 September, 2009). Cheers, Jari Oksanen On Tue, 2011-01-18 at 09:22 +0100, Martin Unterseher wrote:
Dear all, as far as I know, functions specpool and estimateR (both in package vegan) provide only the final values of the non-parametric estimators. In contrast to that, EstimateS calculates a real curve of each estimator function. To me this is of importance to evaluate the stability and reliability of the final value calculated by the respective estimator. Carsten Dormann found a way to achieve this in R and provided this function for me:
reps=100 sequence.abies.myk<-1:nrow(abies.myk.com) #abies.myk.com is my
species-samples matrix from mycorrhizal fungi of Abies alba
res.abies.myk<-matrix(ncol=9, nrow=length(sequence.abies.myk)) colnames(res.abies.myk)<-names(est.abies.myk) #est.abies.myk is the
result from specpool(abies.myk.com)
for (i in sequence.abies.myk)
{
sample.raw.abies.myk <- replicate(reps,
specpool(abies.myk.com[sample(x=1:nrow(abies.myk.com), size=i),]),
simplify=TRUE)
subsample.abies.myk <- matrix(unlist(sample.raw.abies.myk),
nrow=9, ncol=reps)
rownames(subsample.abies.myk) <- names(sample.raw.abies.myk)
res.abies.myk[i, ] <- rowMeans(subsample.abies.myk)
}
It works fine. For small data sets and many replications, curves
shapes are in concordance with the EstimateS output. For larger data
however, calculations with high values of "reps" would take hours to
days. If you use small values for "reps" instead the curves will
appear jagged and are often not publishable.
Does any one know of alternatives to display estimator curves in R?
Thanks
Martin
__________
Dr. Martin Unterseher
Universit?t Greifswald
Institut f?r Botanik und Landschafts?kologie
Lehrstuhl f?r Allgemeine und Spezielle Botanik
Grimmer Str. 88
17487 Greifswald
Tel. 03834 / 864184
Fax. 03834 / 864114
http://www.botanik.uni-greifswald.de/100.html
http://dgfm-ev.de/index.php?id=munterseher
_______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
__________ Dr. Martin Unterseher Universit?t Greifswald Institut f?r Botanik und Landschafts?kologie Lehrstuhl f?r Allgemeine und Spezielle Botanik Grimmer Str. 88 17487 Greifswald Tel. 03834 / 864184 Fax. 03834 / 864114 http://www.botanik.uni-greifswald.de/100.html http://dgfm-ev.de/index.php?id=munterseher
On 21/01/11 15:32 PM, "Martin Unterseher"
<martin.unterseher at uni-greifswald.de> wrote:
Dear Jari,
thank you for your help. The plots are fine and really valuable.
However, when I tried to generate a Sweave-based file, all plot()
commands following poolaccum() (e.g.
\begin{figure}
<<fig=true>>
pool.data<-poolaccum(data)
plot(pool.data)
@
\end{figure}
resulted in empty or corrupted pdf files. I solved this problem by
manually saving the poolaccum- plots as pdf and including them in the
resulting .tex file. Some time-consuming handwork, but ok. So there is
no urgent need for response.
Martin,
This is a quick guess: I haven't checked this. However, I think you should
set
\begin{figure}
<<fig=true,echo=false>>=
...
@
\end{figure}
If you create the fig within latex figure environment, you should only have
the figure, but now you also echo the commands in the same environment.
Cheers, Jari