fake_survey: Base transport

fake_survey_peopleR Documentation

Base transport

Description

Base transport

Create fake transport sondage

Usage

fake_survey_people(n, seed = 2811, local = c("fr_FR"))

fake_sondage_people(...)

fake_survey_answers(n = 200, x, seed = 2811, split = FALSE, local = c("fr_FR"))

fake_sondage_answers(...)

Arguments

n

Number of sondage

seed

fixe la graine aleatoire

local

the local of the base. Currently supported : "fr_FR" and "en_US".

x

Optionnal. fake client data base with "age" column

split

Logical. Split database in individuals and answers

Details

  • id_individu Unique identification of people with "ID-AAAA-1111" pattern

  • sexe. sex. c("F" = "Female", "M" = "Male", "O" = "Other"). Some are missing

  • age age. Some are missing

  • region. some regions have NA values that may be fill with left_join with fra_sf dataset. Some regions are more represented than others

  • id_departement. number identifying French department

  • nom_departement. Name of the department. Some departement have NA values that may be fill using id_departement.

  • question_date. Date/hour when questionnaire has been answered.

  • year. year extracted from question_date

  • 3 types for each individuals: travail, commerces, loisirs

  • distance_km. Average distance (km) to target location. Distance is related to age.

  • transport. Mean of transport to go to target location. Depends on distance.

  • time_travel_hours. Average duration (hours) to target location. Depends on distance and transport.

Value

A dataframe of fake result from a .

Examples

fake_survey_people(10)
answers <- fake_sondage_answers()
if (FALSE){
ggplot(answers) +
  aes(age, log(distance_km), colour = type) +
  geom_point() +
  geom_smooth() +
  facet_wrap(~type, scales = "free_y")
}


fakir documentation built on April 14, 2023, 12:34 a.m.