This is the glimpse() of my dataframe DF:
Observations: 221184
Variables:
$ Epsilon (fctr) 96002.txt, 96002.txt, 96004.txt, 96004.txt, 96005.txt, 960...
$ Value (int) 61914, 61887, 61680, 61649, 61776, 61800, 61753, 61725, 616...
I want to filter (remove) all the observations with the first two levels of Epsilon using dplyr.
I mean:
DF %>% filter(Epsilon != "96002.txt" & Epsilon != "96004.txt")
However, I don't want to use the string values (i.e., "96002.txt" and "96004.txt") but the level orders (i.e., 1 and 2), because it should be a general instruction independent of the level values.
filter(as.numeric(Epsilon)>2)
what you are looking for?factor
s to their numeric/integer representation just by applyingas.numeric
oras.integer
on them (which often causes confusion when it's not inteded).