search for: cannonorir

Displaying 2 results from an estimated 2 matches for "cannonorir".

2011 Feb 14
1
conditional value assignment
Dear R-Help, I am trying to compute a new variable, let's call it "target cannon orientation (tco)" based conditionally on old variables, "TargetColor," "CannonOriB," and "CannonOriR." For every case in the data set, if TargetColor is "B" then I want tco to equal the value for that case of CannonOirB, else CannonOriR. I've tried writing for loops and functions that I can feed to sapply. I suspect there must be a simple solution but I cannot seem to get either...
2010 Mar 06
1
transposing data
...ed at each combination of each level of all the variables listed in the timevar argument: exp1.r5.wide <- reshape(exp1.r5, idvar="Subject", direction = "wide", sep = "", v.names="RT", timevar = c("CannonAngle", "CannonOriB", "CannonOriR", "nRedPellets", "TargetColor", "tbearing")) Instead what I get is Subject plus six variables that are some sort of conjunctions of all the levels of each of the variables I want. Instead what I want is Subject plus up to 1,008 variables encoding RT at ever...