You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to do some custom plots (with ggplot), I was investigating the format of the list invisibly returned by rarecurve(). My understanding is the sample name is stored as the name of the last item of the Subsample attribute - please correct me if I am wrong.
Then, trying to manipulate the list returned by rarecurve(), I discovered a weird random bug: sometimes, the Subsample attribute doesn't get the name of the original sample, and is not set at all - the plot, however, does show the sample name. The bug is somewhat random, affects some datasets but not others, and also depends on the step=150 parameter.
Reproducible example:
library( MASS )
set.seed( 2 )
m <- matrix( rnegbin( 80*4034, 15, 0.0005), 80, 4034 )
colnames( m ) <- paste0( "ASV", 1:4034 )
rownames( m ) <- paste0( "S", 1:80 )
prc <- vegan::rarecurve( m, step = 150, cex = 0.5 )
# with "step = 500" the bug is not triggered
returns NULL (with the above code, "S66" has also a NULL attribute name).
However, as I said, the plot returned do contain the label for "S17", which can be easily found on the plot bellow, as it is the uppermost sample name shown - "S66" is there as well, somewhere.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. We don't use the names on the subsample attribute for the plot. I figured out what was going on and it looks like it wasn't intended for this to be a named vector at all. Just checking a fix.
I am using vegan 2.5-6 and R 3.6.3, .
In order to do some custom plots (with ggplot), I was investigating the format of the list invisibly returned by
rarecurve()
. My understanding is the sample name is stored as the name of the last item of theSubsample
attribute - please correct me if I am wrong.Then, trying to manipulate the list returned by
rarecurve()
, I discovered a weird random bug: sometimes, the Subsample attribute doesn't get the name of the original sample, and is not set at all - the plot, however, does show the sample name. The bug is somewhat random, affects some datasets but not others, and also depends on thestep=150
parameter.Reproducible example:
Then:
returns, as expected, "S1", but:
returns
NULL
(with the above code, "S66" has also aNULL
attribute name).However, as I said, the plot returned do contain the label for "S17", which can be easily found on the plot bellow, as it is the uppermost sample name shown - "S66" is there as well, somewhere.
The text was updated successfully, but these errors were encountered: