How to remove all the characteristics except one in a variable ?

Hi, I have a variable 'DCFLT", which has about 127 characteristics. I just want to keep one characteristic.
All the characteristics are :

> unique(df$DCFLT)
  [1] "99999" "MO001" "AL157" "BE842" "BE912" "BE932" "SUC1L" "SU15U" "SU96F" "BE540" "LU320" "SU983" "SUC1U" "BE111" "SU611" "SU9AP" "BE214" "ALA01"
 [19] "SUC1X" "SUD28" "AL126" "ALQ00" "SUA3H" "SUC1R" "SUC1S" "SUC1W" "SUC25" "AL36M" "SU11Y" "SU43I" "SUA1W" "BE331" "BE355" "BE52A" "BE110" "BE919"
 [37] "SU21T" "SU859" "SUA5D" "SUA37" "BE210" "SU94R" "SU81A" "ALI01" "SUC1C" "AL2MV" "ALH12" "BE348" "BE717" "AL2F0" "AL3UR" "LU312" "BE216" "BE217"
 [55] "BE25S" "BE366" "BE373" "AL3FG" "SU97T" "AL3JO" "ALI00" "BE135" "BE219" "BE21J" "SU51Q" "BE510" "SUC1V" "BE138" "BE234" "BE25M" "BE377" "BE446"
 [73] "LU146" "LU310" "SUC16" "AL2C0" "AL35J" "AL3S3" "LU323" "SU97D" "AL38N" "BE211" "BE349" "LU328" "AL133" "AL32X" "AL3R1" "ALH00" "BE25C" "SUC28"
 [91] "AL2H0" "AL39F" "AL39Z" "BE114" "BE25H" "BE342" "BE62K" "LU317" "SU72P" "SUC1K" "AL3FH" "AL3KK" "AL3ST" "BE347" "LU322" "AL3T4" "ALR01" "BE343"
[109] "SU712" "SUC23" "SUC29" "AL3BI" "AL664" "BE914" "BE920" "SU41Q" "SU9B4" "SUB21" "SUB2H" "SUC18" "AL3CT" "BE24B" "BE570" "SU142" "SU71Q" "SUA4O"
[127] "BE215" "BE620" "LU324" "AL2E0" "BE25R" "AL3HX" "ALR00" "BE21G" "BE336" "BE528" "LU313"

So I just want to keep '99999'.

Thanks in advance if you can help me :slight_smile:

Try this:


df %>% 
  filter(DCFLT == "99999")

Oh thanks it works apparently.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.