Skip to content
Prev 51523 / 398500 Next

Automatic routine - help

for (j in 1:n) df[,j] <- pmin( pmax( df[,j], 0 ), 1 )

should do the job.

Bendix Carstensen

----------------------
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
bxc at steno.dk
www.biostat.ku.dk/~bxc
----------------------