Dear helpeRs, I am looking for an R equivalent of the S function "randomize" but cannot find it anywhere (?randomize, help.search("randomize")). There are some references to "Randomize()" in the list archives, but it is not on my system (R 2.1.1 on Windows XP)... what package is it in? Thanks! Luis -- Luis Tercero, M.Sc. Engler-Bunte-Institut der Universit??t Karlsruhe (TH) Bereich Wasserchemie Engler-Bunte-Ring 1 D-76131 Karlsruhe Tel. +49 721 608 6381 Fax: +49 721 608 7051
On 8/24/05 7:26 AM, "Luis Tercero" <luis.tercero at ebi-wasser.uni-karlsruhe.de> wrote:> Dear helpeRs, > > I am looking for an R equivalent of the S function "randomize" but > cannot find it anywhere (?randomize, help.search("randomize")). There > are some references to "Randomize()" in the list archives, but it is not > on my system (R 2.1.1 on Windows XP)... what package is it in?Try help.search('random'). You can probably use sample (see ?sample) to do what you want. Others may have a more direct equivalent. Sean
Luis Tercero wrote:> Dear helpeRs, > > I am looking for an R equivalent of the S function "randomize" but > cannot find it anywhere (?randomize, help.search("randomize")). There > are some references to "Randomize()" in the list archives, but it is not > on my system (R 2.1.1 on Windows XP)... what package is it in?In principle, you are looking for sample(). If you don't need other values for the "restrict" argument than the default, you can simply define: randomize <- function(x) sample(seq(nrow(x))) Uwe Ligges> Thanks! > > Luis >