Description Usage Arguments Value References See Also Examples
Analogous function for drop_na
and replace_na
in tidyr, but with a different API.
1 2 3 | drop_na_dt(data, ...)
replace_na_dt(data, ..., to)
|
data |
data.frame |
... |
Colunms to be replaced. If not specified, use all columns. |
to |
What value should NA replace by? |
data.table
https://stackoverflow.com/questions/7235657/fastest-way-to-replace-nas-in-a-large-data-table
1 2 3 4 5 6 7 | df <- data.table(x = c(1, 2, NA), y = c("a", NA, "b"))
df %>% drop_na_dt()
df %>% drop_na_dt(x)
df %>% replace_na_dt(to = 0)
df %>% replace_na_dt(x,to = 0)
df %>% replace_na_dt(y,to = 0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.