William Dunlap writes:
> I don't like the idea of having a length-1 dim attribute trigger some
> behavior of sample. (Should a length-2 dim cause it to sample
> rows of a matrix, as unique() and duplicated() do?).
I wasn't too clear. I would want any dim attribute on its first
argument to cause
On 6/18/2015 12:25 AM, Hervé Pagès wrote:
Hi,
Special behavior of sample(x, ...) when length(x) is 1 is of course
a bad feature. I think it pre-dates sample.int() which is what people
should use these days if they want the behavior of sample(x, ...) when
length(x) is 1. And because we now have
Hi,
Special behavior of sample(x, ...) when length(x) is 1 is of course
a bad feature. I think it pre-dates sample.int() which is what people
should use these days if they want the behavior of sample(x, ...) when
length(x) is 1. And because we now have sample.int(), this feature
could in theory b
I don't like the idea of having a length-1 dim attribute trigger some
behavior of sample. (Should a length-2 dim cause it to sample
rows of a matrix, as unique() and duplicated() do?).
S+'s sample() had another argument, 'n', that could be used to
specify the size of the population to sample from
> Then the question would be if this test could be replaced with a new
> argument to sample, e.g. expandSingle, which has TRUE as default for
> backward compatibility, but FALSE if you dont want population to be
> expanded to 1:population. It could certainly be useful in some cases,
> but you s
On 6/16/2015 1:32 PM, Peter Meissner wrote:
Am .06.2015, 14:55 Uhr, schrieb Millot Gael :
Hi.
I have a problem with the default behavior of sample(), which performs
sample(1:x) when x is a single value.
This behavior is well explained in ?sample.
However, this behavior is annoying when the n
Am .06.2015, 14:55 Uhr, schrieb Millot Gael :
Hi.
I have a problem with the default behavior of sample(), which performs
sample(1:x) when x is a single value.
This behavior is well explained in ?sample.
However, this behavior is annoying when the number of value is not
predictable. Would i
You're not the first one, e.g.
https://stat.ethz.ch/pipermail/r-devel/2010-March/057029.html
https://stat.ethz.ch/pipermail/r-devel/2010-November/058981.html
(I was bitten by this in a resampling scheme where the set sampled
from was data driven).
Here's a simple solution - taken from R.utils::r
Hi.
I have a problem with the default behavior of sample(), which performs
sample(1:x) when x is a single value.
This behavior is well explained in ?sample.
However, this behavior is annoying when the number of value is not predictable.
Would it be possible to add an argument
that desactivates t