Dear all,
I used which to obtain a subset of values from my data.frame.
however, I find that there is a trace of the values I have removed.
Any suggestions would be greatly appreciate.
Below is my data:
d - data.frame( val = 1:10,
group = sample(LETTERS[1:5], 10,
Tania Oh wrote:
Dear all,
I used which to obtain a subset of values from my data.frame.
however, I find that there is a trace of the values I have removed.
Any suggestions would be greatly appreciate.
Below is my data:
d - data.frame( val = 1:10,
group =
Dear Uwe,
thank you very much for this.
After reading your solution below, I searched the help pages for
data.frame, which, factor but I didn't see the option for drop in
them.
I googled and found drop associated with the function subset. is
this the help page you were alluding to?
Sorry
[EMAIL PROTECTED] wrote:
I used which to obtain a subset of values from my data.frame.
however, I find that there is a trace of the values I have removed.
Any suggestions would be greatly appreciate.
Below is my data:
d - data.frame( val = 1:10,
group =
The (imho) unintuitive behaviour is to do with the subsetting function
[.factor, not which. There are a couple of workarounds:
In that case, your intuition needs readjustment
There are other systems which (de facto) drop unused levels by default,
and it is a real pain to work
Tania Oh wrote:
Dear Uwe,
thank you very much for this.
After reading your solution below, I searched the help pages for
data.frame, which, factor but I didn't see the option for drop in them.
In fact, ?factor links to ?[.factor whcih explains it.
Uwe
I googled and found drop
6 matches
Mail list logo