0

I am working with R and I have a tibble that contains 5,000 rows. My data looks similar to this...

**word   number   time**
pool       3       day
car        1       night
computer   6       night
table      4       day
road       2       day
pub        5       night 

I have a list of words that I dond't need anymore. Let's say "car", "road" and "pub". So, I want to remove this list of words from the tibble in order to correctly use my tibble.

Ajrhjnd
  • 330
  • 1
  • 9

1 Answers1

1

Using dplyr(** goes .. when I read the data),

df <- read.table(text = "**word   number   time**
pool       3       day
car        1       night
computer   6       night
table      4       day
road       2       day
pub        5       night ", header = T)

df %>%
  filter(!(X..word %in% c("car", "road", "pub")))

   X..word number time..
1     pool      3    day
2 computer      6  night
3    table      4    day
Park
  • 14,771
  • 6
  • 10
  • 29