Add a title column to the idbank list dataset
add_insee_title(df, n_split, lang = "en", split = TRUE, clean = TRUE)
a dataframe containing an idbank column called "idbank" or "IDBANK"
number of new columns, by default the maximum is chosen
returns an English title, by default is "en", any other value returns a French title
split the title column in several columns, by default is TRUE
remove the columns filled with NA (missing value), by default is TRUE
the same dataframe but with one or several title columns
this function uses extensively the get_insee_title function. Then, it should be used on an already filtered dataset, not on the full idbank dataset (cf. get_insee_title). The number of separators in the official INSEE title can vary and is not normalized. Beware all title columns created may not be a cleaned dimension label.
# \donttest{
library(magrittr)
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
idbank_empl =
get_idbank_list("EMPLOI-SALARIE-TRIM-NATIONAL") %>% #employment
slice(1:15) %>%
add_insee_title()
#> Cached data has been used
#> 1/1 - Data download & Dataframe build :
#>
|
| | 0%
|
|===== | 7%
|
|========== | 14%
|
|=============== | 21%
|
|==================== | 29%
|
|========================= | 36%
|
|============================== | 43%
|
|=================================== | 50%
|
|======================================== | 57%
|
|============================================= | 64%
|
|================================================== | 71%
|
|======================================================= | 79%
|
|============================================================ | 86%
|
|================================================================= | 93%
|
|======================================================================| 100%
#>
#> Data cached : /var/folders/4d/0gnh84wj53j7wyk695q0tc_80000gn/T//RtmpLADV6b/be307ca56b7c52877368d584c3724c83.rds
#>
# }