Hello Charles,

thank you for the hint.


Zitat von "Charles C. Berry" <[EMAIL PROTECTED]>:

[...]
> > This looks good (and correct to me).
>
> Look again .
>
> It is not the same as what you have above.
[...]


OK, yes, you are right!

I mixed the two parameters...


Now I get the same problem also at the shell directly typed in:


=====================
> as.matrix(    replicate(10, sample(x, 3) )  )
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]   12   15    3   12    7    4    4   14    6    20
[2,]    6   11    1    4    6   19   17   11   19    11
[3,]   20   17    6    8    3   14   19   10    2    14
>
> as.matrix(    replicate(10, sample(x, 2) )  )
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    4   17   18   14    6   11    5   17   13    13
[2,]   14    3   16   12   17    7   20   16    2    17
>
> as.matrix(    replicate(10, sample(x, 1) )  )
      [,1]
 [1,]   19
 [2,]   17
 [3,]   12
 [4,]   14
 [5,]   12
 [6,]   13
 [7,]   18
 [8,]   12
 [9,]    5
[10,]   20
> dim( as.matrix(    replicate(10, sample(x, 3) )  ) )
[1]  3 10
> dim( as.matrix(    replicate(10, sample(x, 2) )  ) )
[1]  2 10
> dim( as.matrix(    replicate(10, sample(x, 1) )  ) )
[1] 10  1
>
=====================


So, the behaviour is the same...
...but is not really that fine. :(

...how could I avoid the necessity of the transposition
of the matrix in the case of only one sample?

I mean, it's not extremely a problem,
because there are not many loops aroud it,
but it looks somehow ugly. :(

Ciao,
  Oliver

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to