Hello, again.
There was another error in the line in question. TRUE does not need
quotes. In fact, with quotes you're comparing to a character string, not
to a logical value.
And the other tip still holds, use as follows in the complete and
corrected line below.
Health2PairsOnly <- PairIDs[
Hello,
That way of refering to variables can be troublesome. Try
PairIDs[, "Pairiddups"]
Hope this helps,
Rui Barradas
Em 27-09-2012 20:46, GradStudentDD escreveu:
Hi,
I have a data set of observations by either one person or a pair of people.
I want to only keep the pair observations, and
#By using cbind in:
PairIDs<-cbind(PairID, PairIDDuplicates)
#You create a numeric matrix (the logical
#vector PairIDDuplicates gets converted
#to numeric - note that your second column
#contains 1s and 0s, not Trues and Falses).
#Matricies are not subsetable using $,
#they are basically a vector
Hi,
I have a data set of observations by either one person or a pair of people.
I want to only keep the pair observations, and was using the code below
until it gave me the error " $ operator is invalid for atomic vectors". I am
just beginning to learn R, so I apologize if the code is really rough
4 matches
Mail list logo