hablar 类型转换
library(hablar)
mtcars %>%
convert(num(gear),
chr(mpg),
fct(cyl))
df <- data.frame(a = c("A", NA, "B", "C", "C"),
b = c(NA, 1, 1, 3, 3),
c = c(7, 8, 2, 3, 3),
stringsAsFactors = FALSE)
# Returns duplicated rows
df %>% find_duplicates()
df %>% find_duplicates(b:c)
df %>% find_na(b)
mtcars %>%
convert(num(gear),
chr(mpg),
fct(cyl))
df <- data.frame(a = c("A", NA, "B", "C", "C"),
b = c(NA, 1, 1, 3, 3),
c = c(7, 8, 2, 3, 3),
stringsAsFactors = FALSE)
# Returns duplicated rows
df %>% find_duplicates()
df %>% find_duplicates(b:c)
df %>% find_na(b)
评论
发表评论