Displaying 4 results from an estimated 4 matches for "ix48".
Did you mean:
0x48
2004 Jul 23
2
retrieve rows from frame assuming criterion
Hi all,
I have a data frame in which one column(PUNTAR) is of character type.
What I want is to retrieve is the frame but only with those rows matching elements of PUNTAR with a list characters (e.g c("IX49","IX48") )
Year TUR STODNR PUNTAR
1994 9412 94020061 IX49
1994 9412 94020062 IX48
1994 9412 94020063 X32
1994 9412 94020065 X23
1994 9412 94020066 X27
1994 9412 94020067 XI19
1994 9412 94020068 XI16
1994 9412 94020069 XI14
1994 9412 94020070 XI8...
2004 Jul 23
1
R: retrieve rows from frame assuming criterion [corrected]
sorry for my previus (WRONG)
answer, as someone already pointed out
a solution could be
subset(data, PUNTAR==c("IX49","IX48"))
> -----Messaggio originale-----
> Da: Guazzetti Stefano
> Inviato: venerd?? 23 luglio 2004 15.55
> A: 'Luis Rideau Cruz'; r-help at stat.math.ethz.ch
> Oggetto: R: [R] retrieve rows from frame assuming criterion
>
>
> Assuming your data.frame is called...
2004 Jul 23
0
retrieve rows from frame assuming criterion [corrected]
...What matters is the use of "%in%" instead of "==", not the use of subset().
Andy
> From: Guazzetti Stefano
>
> sorry for my previus (WRONG)
> answer, as someone already pointed out
> a solution could be
>
> subset(data, PUNTAR==c("IX49","IX48"))
>
>
>
> > -----Messaggio originale-----
> > Da: Guazzetti Stefano
> > Inviato: venerd?? 23 luglio 2004 15.55
> > A: 'Luis Rideau Cruz'; r-help at stat.math.ethz.ch
> > Oggetto: R: [R] retrieve rows from frame assuming criterion
> >
&...
2004 Jul 23
0
R: R: retrieve rows from frame assuming criterion [corrected]
...rom frame assuming criterion
> [corrected]
>
>
> On Fri, 23 Jul 2004, Guazzetti Stefano wrote:
>
> > sorry for my previus (WRONG)
> > answer, as someone already pointed out
> > a solution could be
> >
> > subset(data, PUNTAR==c("IX49","IX48"))
>
> That's still wrong. You want PUNTAR %in% c("IX49","IX48"). Using ==
> recycles entries, so it tests the first element against
> "IX49", the second
> against "IX48", the third against "IX49" ....
>
> > >...