co = container(a = 1, b = 2, 3)
delete_at(co, "a", "b") # [3]
delete_at(co, 1:2) # [3]
delete_at(co, "a", 3) # [b = 2]
try({
delete_at(co, 4) # index out of range
delete_at(co, "x") # names(s) not found: 'x'
})
dit = as.dict.table(head(sleep))
dit
delete_at(dit, "ID")
delete_at(dit, "ID", 1)
try({
delete_at(dit, "foo") # Column 'foo' not in dict.table
})
Run the code above in your browser using DataLab