Commit f766de6f authored by Jean-Francois Rey's avatar Jean-Francois Rey

add CI cluster to get immunity rate data and merge it using rscript immunity.R

parent da8a64b6
Pipeline #2020 passed with stages
in 3 minutes and 32 seconds
......@@ -70,11 +70,13 @@ mergeData:
allow_failure: true
script:
- 'cd R && Rscript main_forecast_plotly.R "merge"'
- "Rscript R/immunity.R && mv immun_M3_k.rds data/"
- "curl --request POST --form token=$TRIGGERTOKEN --form ref=master https://gitlab.paca.inrae.fr/api/v4/projects/105/trigger/pipeline"
artifacts:
paths:
- R/list_figures.rds
expire_in: 1 week
- data/immun_M3_k.rds
expire_in: 2 weeks
## Build docker image of the R shiny app
## using DockerFile and register it in the
......
#!/usr/bin/env Rscript
## List all files
files <- list.files(path="/mnt/biomstock/Cluster/biometrie/parsi_covid/SUIVI_COVID/COVIDM3", pattern='immun_M3_k[0-9]+.txt', full.names= TRUE)
## order files by week
order_files <- files[order(nchar(files),files)]
first_date <- as.Date("2020-03-30")
## read all file contain
read_files <- lapply(order_files, FUN = function(f) {
return( as.numeric(read.csv(f, header=FALSE, sep = ",", dec = ".")))
})
## add date as list names (index)
lapply(seq_along(read_files), function(i) { names(read_files)[[i]] <<- as.character(first_date + 7*i)})
## save it
saveRDS(read_files, "immun_M3_k.rds")
......@@ -87,7 +87,7 @@ labelText = function(x,y,z){
# immun_M3_k[[i]] = as.numeric(readr::read_csv(paste0("~/Documents/coronavirus/immunity/immun_M3_k", i,".txt"), col_names = FALSE))
# }
# names(immun_M3_k) = vecDate
# write_rds(immun_M3_k, "www/immun_M3_k.rds")
# write_rds(immun_M3_k, "data/immun_M3_k.rds")
#
# library(sf)
# library(dplyr)
......@@ -100,10 +100,10 @@ labelText = function(x,y,z){
#
# mapFranceDepartement_Corse = sf::st_union(dplyr::filter(mapFranceDepartement, nom == "Corse-du-Sud"),
# dplyr::filter(mapFranceDepartement, nom == "Haute-Corse"))
# write_rds(mapFranceDepartement, "www/mapFranceDepartement.rds")
# write_rds(mapFranceDepartement, "data/mapFranceDepartement.rds")
mapFranceDepartement = readRDS("www/mapFranceDepartement.rds")
immun_M3_k = readRDS("www/immun_M3_k.rds")
mapFranceDepartement = readRDS("data/mapFranceDepartement.rds")
immun_M3_k = readRDS("data/immun_M3_k.rds")
immunityDate = as.Date(names(immun_M3_k))
# I = dataDEATHclean %>%
......
Markdown is supported
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