David Winsemius <[EMAIL PROTECTED]> wrote :
> On 31 Jan 2008, Stanley wrote:
>> sample(x) only permutates and/or samples from a vector, which I
>> can't use for a matrix. Please help.
>
> You just feed sample(.) a "redimensioned" object. If you need to do
> it programmatically just multiply the
I mean
On Thu, Jan 31, 2008 at 02:32:20PM +0100, Gabor Csardi wrote:
> What exactly is the question? Selecting/permuting rows?
>
> M[sample(length=nrow(M), count), ]
M[sample(seq(length=nrow(M)), count), ]
> Selecting/permuting columns?
>
> M[ , sample(length=ncol(M), count) ]
M[ , sample(seq
On 31 Jan 2008, you wrote in gmane.comp.lang.r.general:
> Hi,
>
> sample(x) only permutates and/or samples from a vector, which I
> can't use for a matrix. Please help.
You just feed sample(.) a "redimensioned" object. If you need to do it
programmatically just multiply the dimensions of the
What exactly is the question? Selecting/permuting rows?
M[sample(length=nrow(M), count), ]
Selecting/permuting columns?
M[ , sample(length=ncol(M), count) ]
Permuting elements?
structure(sample(M), dim=dim(M))
Selecting elements?
sample(M, count)
Gabor
On Thu, Jan 31, 2008 at 09:10:11PM +0
Hi,
sample(x) only permutates and/or samples from a vector, which I can't use
for a matrix. Please help.
Thanks
Stanley
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEA
5 matches
Mail list logo