set_int {framecleaner} | R Documentation |
set integer
Description
set integer
Usage
set_int(.data, ...)
## S3 method for class 'data.frame'
set_int(.data, ...)
## S3 method for class 'grouped_df'
set_int(.data, ...)
Arguments
.data |
dataframe |
... |
tidyselect. Default Selecton: integerish doubles or integerish characters |
Value
tibble
Examples
int_vec <- c("1", "2", "10")
tibble::tibble(
chr_int = int_vec,
dbl_int = c(1.0, 5.0, 20.0),
chr_int64 = c("1033493932", "4432500065", "30303022192"),
string_int = c("SALES2020", "SALES2021", "SALES2022")) -> tbl
# automatically coerce integerish cols in a tibble
tbl
# integerish doubles or chars will be detected for coercion automatically
tbl %>%
set_int()
# string_int requires parsing, so it must be specified directly for coercion
tbl %>%
set_int(matches("str|chr"))
# s3 method works for vectors as well
int_vec
int_vec %>%
set_int()
[Package framecleaner version 0.2.1 Index]