add_insee_title: Add a title column to the idbank list dataset

Description Usage Arguments Details Value Examples

View source: R/add_insee_title.R

Description

Add a title column to the idbank list dataset

Usage

1
add_insee_title(df, n_split, lang = "en", split = TRUE, clean = TRUE)

Arguments

df

a dataframe containing an idbank column called "idbank" or "IDBANK"

n_split

number of new columns, by default the maximum is chosen

lang

returns an English title, by default is "en", any other value returns a French title

split

split the title column in several columns, by default is TRUE

clean

remove the columns filled with NA (missing value), by default is TRUE

Details

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.

Value

the same dataframe but with one or several title columns

Examples

1
2
3
4
5
6
library(tidyverse)

idbank_empl =
 get_idbank_list("EMPLOI-SALARIE-TRIM-NATIONAL") %>% #employment
 slice(1:15) %>%
 add_insee_title()

hadrilec/insee documentation built on Oct. 13, 2021, 12:03 p.m.