We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delete_columns()
In previous versions, data.table errored if you tried to delete a column that didn't exist. We therefore have a function
data.table
delete_columns <- function(df, cols_to_delete, make_unique = FALSE) { df <- data.table::as.data.table(df) delete_columns <- names(df)[names(df) %in% cols_to_delete] if (length(delete_columns) > 0) { if (make_unique) { df <- unique(df[, eval(delete_columns) := NULL]) } else { df <- df[, eval(delete_columns) := NULL] } } return(df) }
We could alternatively replace this with suppressWarnings(dt[, coltodelete := NULL). Any objections?
suppressWarnings(dt[, coltodelete := NULL)
The text was updated successfully, but these errors were encountered:
@sbfnk, @sbfnk
Sorry, something went wrong.
Merge pull request #529 from epiforecasts/remove-delete_columns
5c3a1f4
Issue #446: Remove function `delete_columns()`
Fixed via #529
No branches or pull requests
In previous versions,
data.table
errored if you tried to delete a column that didn't exist. We therefore have a functionWe could alternatively replace this with
suppressWarnings(dt[, coltodelete := NULL)
. Any objections?The text was updated successfully, but these errors were encountered: