Commit 91081bf3 authored by Grelot Frederic's avatar Grelot Frederic :swimmer_tone5:
Browse files

Merge branch '8-refactor-map_so_ii-theme' into 'master'

Resolve "refactor map_so_ii theme"

Closes #8

See merge request !10
Showing with 428 additions and 370 deletions
+428 -370
Package: geau Package: geau
Title: Utilities very useful to share within geau-inondation team Title: Utilities very useful to share within geau-inondation team
Version: 1.0.7.0 Version: 1.0.8.0
Authors@R: Authors@R:
c( c(
person(given = "Frédéric", person(given = "Frédéric",
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
#' #'
#' A dataset containing the population of commune in so-ii according to INSEE. #' A dataset containing the population of commune in so-ii according to INSEE.
#' #'
#' @format numeric matrix #' @format numeric matrix 78 rows, 33 columns
#' \describe{ #' \describe{
#' \item{row}{commune as in so_ii_scope} #' \item{row}{commune as in so_ii_scope}
#' \item{column}{year} #' \item{column}{year}
......
This diff is collapsed.
...@@ -4,25 +4,11 @@ so_ii_onrn = read.csv2( ...@@ -4,25 +4,11 @@ so_ii_onrn = read.csv2(
geau::current_version("data-common/so-ii/onrn"), geau::current_version("data-common/so-ii/onrn"),
row.names = 1 row.names = 1
) )
class(so_ii_population) = "data.frame" so_ii_onrn = so_ii_onrn[geau::so_ii_scope, ]
rownames(so_ii_population) = so_ii_population[["CODGEO"]]
selection = grep(
"PMUN|PSCDC|PTOT",
colnames(so_ii_population),
value = TRUE
)
so_ii_population = as.matrix(
so_ii_population[geau::so_ii_scope, selection]
)
year = gsub("PMUN", "20", selection)
year = gsub("PTOT", "19", year)
year = gsub("1919", "19", year)
year = gsub("1918", "18", year)
dimnames(so_ii_population)[[2]] = year
# updating datasets # updating datasets
# actual = setwd(file.path(system.file(package = "geau"), "..")) # actual = setwd(file.path(system.file(package = "geau"), ".."))
actual = setwd("geau") actual = setwd("geau")
usethis::use_data(so_ii_population, internal = FALSE, overwrite = TRUE) usethis::use_data(so_ii_onrn, internal = FALSE, overwrite = TRUE)
setwd(actual) setwd(actual)
...@@ -11,7 +11,7 @@ so_ii_population = readxl::read_xlsx( ...@@ -11,7 +11,7 @@ so_ii_population = readxl::read_xlsx(
class(so_ii_population) = "data.frame" class(so_ii_population) = "data.frame"
rownames(so_ii_population) = so_ii_population[["CODGEO"]] rownames(so_ii_population) = so_ii_population[["CODGEO"]]
selection = grep( selection = grep(
"PMUN|PSCDC|PTOT", "PMUN|PSDC|PTOT",
colnames(so_ii_population), colnames(so_ii_population),
value = TRUE value = TRUE
) )
...@@ -19,6 +19,7 @@ so_ii_population = as.matrix( ...@@ -19,6 +19,7 @@ so_ii_population = as.matrix(
so_ii_population[geau::so_ii_scope, selection] so_ii_population[geau::so_ii_scope, selection]
) )
year = gsub("PMUN", "20", selection) year = gsub("PMUN", "20", selection)
year = gsub("PSDC", "19", year)
year = gsub("PTOT", "19", year) year = gsub("PTOT", "19", year)
year = gsub("1919", "19", year) year = gsub("1919", "19", year)
year = gsub("1918", "18", year) year = gsub("1918", "18", year)
......
No preview for this file type
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
\alias{so_ii_population} \alias{so_ii_population}
\title{Population for so-ii} \title{Population for so-ii}
\format{ \format{
numeric matrix numeric matrix 78 rows, 33 columns
\describe{ \describe{
\item{row}{commune as in so_ii_scope} \item{row}{commune as in so_ii_scope}
\item{column}{year} \item{column}{year}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment