Displaying 2 results from an estimated 2 matches for "subjnr".
Did you mean:
subjno
2002 Jul 16
2
selectively aggregate data
I'm shure that this kind of question is asked not for the fist time, but
i would be glad if someone of you could help me out
I have a data.frame like this :
subjnr group block data
1 33 1 1 564.476
2 33 1 1 289.185
3 33 1 1 483.372
4 33 1 1 1461.260
5 33 1 1 315.353
6 33 1 1 351.870
7 33 1 1 1238.350
8 33 1 1 218.135
9 33 1 1...
1999 Jan 04
1
Names of data frame columns in an apply
...e. To identify what kind of "experiments"
the subjects did, I want to combine these levels into one variable
describing the type of experiment they did.
[the problem]
I wrote a function to recode 5 variables into one variable. These 5
variables are stored in a data frame. For example:
subjnr time var1 var2 var3 var4 var5 outcome
1 1 1 0 2 1 0 20
2 1 0 1 2 1 0 20
When I try to recode a data set like this, using (something like):
recode <- function(dataline) <-
type <- 0;
if (dataline$var1 == 1) {
type <- 1;
}
if (da...