The following treatment are performed:

  • Only some fileds are selected, field names (colnames) are consistently set.

  • NA values are consistently set.

  • Type of fields are consistently set, some checks are performed on transformations.

  • Data set is cut and saved by departments

  • Only observations with spatial coordinates are kept.

  • Exposition of observations (belonging or not to eaip) is added.

adapt.geo_sirene(
  origin,
  destination,
  archive,
  export = "fst",
  scheme = floodam.data::scheme_sirene_2019,
  na_value = floodam.data::scheme_sirene_na,
  eaip_path = NULL,
  projection = 4326,
  order_by = c("state", "eaip"),
  retrieve = FALSE,
  verbose = FALSE
)

Arguments

origin

character, path to the directory where archive are stored

destination

character, path to the directory where results should be saved

archive

character, vector of archive to be adpated

export

character, option for export format of the results

scheme

data.frame, how archive variables should be treated

na_value

data.frame, list of NA values for each variables

eaip_path

character, path where eaip archives should be find

projection

optional numeric, 4 digits projection to use

order_by

optional character, name of the variable to sort the output data. Default sorting is by state and eaip (if added).

retrieve

logical, should the result be returned

verbose

logical, should the function give some sumup informations.

Value

if retrieve = TRUE, data.frame of adapated data stored in archive.

Author

Victor Champonnois et Frédéric Grelot

Examples


if (FALSE) {
origin = ""
destination = tempdir()
archive = "geo_siret_34.csv.gz"
result = adapt.geo_sirene(origin, destination, verbose = TRUE, retrieve = TRUE)
}