missing: Dump or replace missing values in data.frame

Description Usage Arguments Value References See Also Examples

Description

Analogous function for drop_na and replace_na in tidyr, but with a different API.

Usage

1
2
3

Arguments

data

data.frame

...

Colunms to be replaced. If not specified, use all columns.

to

What value should NA replace by?

Value

data.table

References

https://stackoverflow.com/questions/7235657/fastest-way-to-replace-nas-in-a-large-data-table

See Also

drop_na,replace_na

Examples

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)

hope-data-science/tidydt documentation built on Feb. 21, 2020, 10:25 a.m.