Displaying 1 result from an estimated 1 matches for "nes2004".
2008 Oct 01
2
an unsophisticated question about recoding in a data frame with control structure if {}
...me$thevector<-(an arithmetic mean). What I would like to result is the creation of a new variable within the data frame for which all observations that =='3' get the mean. Yet, I receive an error message that R is only reading the first element of the factor:
Warning message:
In if (nes2004$Rrace2 == "1") { :
the condition has length > 1 and only the first element will be used
As the command in question actually appears:
if (nes2004$Rrace2=='3') {
nes2004$Hethno<-(((nes2004$Hint-nes2004$Wint)+(nes2004$Hint-nes2004$Bint)+(nes2004$Hint-nes2004$Aint)+(nes2004$...