0

I have a data.frame like this:

user_id    item_id     serie_a
100         36         Blood_honor
100         81         Dungeon_dragon
100         90         Blue_witch
100         34         Scorpion_Valley
100         45         the_nob_hideout
100         56         ruins_of_meroeden     
100         33         the_grail

I want to delete the following item_id : 81,34,56,33, and I want to keep the remaining structure, the names in serie_a and number user_id. Well, the original data.frame is much larger than the one shown here, the thing is that I want to erase more data following the same path explained,but I don't know how to do it in a row. Thanks.

Roy
  • 19
  • 4
  • Also, https://stackoverflow.com/questions/5584597/how-to-filter-a-tables-row-based-on-an-external-list – Zero Jul 10 '17 at 16:51

2 Answers2

0

You can get this with

df = df[!df$item_id %in% c(81,34,56,33), ]
G5W
  • 36,531
  • 10
  • 47
  • 80
0
library(magrittr)
library(dplyr)

df %<>% filter(!(item_id %in% c(81,34,56,33)))
Dan
  • 11,370
  • 4
  • 43
  • 68