[R] loop of quartile groups

2012-10-17 Thread Charles Determan Jr
Greetings R users, My goal is to generate quartile groups of each variable in my data set. I would like each experiment to have its designated group added as a subsequent column. I can accomplish this individually with the following code: brks - with(data_variables, cut2(var2,

Re: [R] loop of quartile groups

2012-10-17 Thread Rui Barradas
Hello, There's no function cut2() but it's not very difficult to write one. I've named your data example 'dat', it saves keystrokes. Try the following. dat - structure(...etc...) cut2 - function(x, g = 0){ cut(x, breaks = c(-Inf, seq(min(x), max(x), length.out = g))) } fun - function(x)

Re: [R] loop of quartile groups

2012-10-17 Thread David Winsemius
On Oct 17, 2012, at 7:23 AM, Charles Determan Jr wrote: Greetings R users, My goal is to generate quartile groups of each variable in my data set. I would like each experiment to have its designated group added as a subsequent column. I can accomplish this individually with the