Re: [R] Sample function in R

2012-02-12 Thread SUPAKORN LAOHAPITAKVORN
252 attached base packages: [1] stats graphics grDevices utils datasets methods base > ls() [1] "a" "sample" On Sun, Feb 12, 2012 at 12:52 PM, SUPAKORN LAOHAPITAKVORN < klangklang2...@gmail.com> wrote: > Hi, > Can anyone help me with the sam

[R] Sample function in R

2012-02-12 Thread SUPAKORN LAOHAPITAKVORN
Hi, Can anyone help me with the sample () in R? If I sample from x, I should get one integer. Can anyone tell me what's wrong here? > x =1:12 > sample(x) [1] 6.5 And, I cannot get the sample with size = 2 > sample(x, size = 2) Error in sample(x, size = 2) : unused argument(s) (size = 2) > sample