Displaying 1 result from an estimated 1 matches for "currfield".
Did you mean:
cornfield
2011 Jan 26
1
How to call subset in a for loop?
...ch one of the fields 'myField' can have
several possible values. To extract the observations for which it has value
"A", I can do:
subset(myDf, myField="A")
However, when I try to do this within a loop, it doesn't work, it returns
everything, and not a subset
for (currField in c("A", "B", "C")){
subset(myDf, myField=currField)
}
How should I modify the call of subset in the loop to make it work?
Thanks for your help!
Adi
--
Aditya Bhagwat
[[alternative HTML version deleted]]