Reputation: 463
I have a large list of dataframes. I would like to remove one specific dataframe e.g. d2 in this example.
my.list
$d1
y1 y2
1 1 4
2 2 5
3 3 6
$d2
y1 y2
1 3 6
2 2 5
3 1 4
Upvotes: 3
Views: 7557
Reputation: 145835
A few options:
# assign it to NULL
my.list$d2 = NULL
my.list[["d2"]] = NULL
# remove second item
my.list = my.list[-2]
# subset by name
my.list = my.list[names(my.list) != "d2"]
Upvotes: 8