-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
inst/rmarkdown/templates/template-eppexist/skeleton/skeleton.Rmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
title: "Template Title" | ||
author: "Your Name" | ||
date: "`r format(Sys.time(), '%d de %B, %Y')`" | ||
output: output_format | ||
bibliography: skeleton.bib | ||
link-citations: yes | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = TRUE) | ||
require(EPP) | ||
centers <- centers_epp # Inlcude here your centers data | ||
pop <- pop_epp # Inlcude here your population data | ||
var_of_weight <- "ICC" # Name of the variable used as weight. | ||
# Include here others parameters of your case | ||
# n <- 3 # Total number of iterations with the distance "d1". | ||
# m <- 0 # Number of iteration in wich change the distance of radium. If m>n only the first distance is usede. | ||
# d1 <- 1000 # Radius in meters that each center covers in the firsts "n" iterations. | ||
# d2 <- 2000 # Radius in meters that each center covers, the last "m" iterations. Default = d1 * 2 | ||
crs <- sp::CRS("+init=epsg:32721") # Coordinate Reference Systems (CRS). | ||
``` | ||
|
||
## Inputs | ||
|
||
This report present the coverage evaluation of `r nrow(centers)` centers, and the coverage of `r nrow(pop)` individuals with a `r mean(pop$weight)` mean of `r var_of_weight`. | ||
|
||
## Outputs | ||
|
||
```{r} | ||
exist <- eppexist(pop = pop, centers = centers, crs = crs) | ||
``` | ||
|
||
The population how may be out of coverage are `r nrow(exist$pop_uncover)` with a `r mean(exist$pop_uncover$weight)` mean of `r var_of_weight`. | ||
|
||
The population assigned to the corresponding center are `r nrow(exist$pop_assigned)` with a `r mean(exist$pop_assigned$weight)` mean of `r var_of_weight`. | ||
|
||
```{r} | ||
ggplot(exist$pop_assigned, aes(x = id, y = weight, color = iteration)) + | ||
geom_point(size=6) | ||
``` | ||
|
||
From the point of the centers, let's look at the unused capacity after processing, to evaluate which centers need to be analyzed for excess supply of quotas. | ||
|
||
```{r} | ||
ggplot(exist$remaining_capacity, aes(x = id, y = capacity)) + | ||
geom_point(size=6) | ||
``` | ||
|
||
# Bibliography | ||
|
||
```{r bib, include=FALSE} | ||
# create a bib file for the R packages used in this document | ||
knitr::write_bib(c('base', 'rmarkdown', 'EPP'), file = 'skeleton.bib') | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: Template eppexist | ||
description: > | ||
This template may help with the description of the results of the return of eppexist function of EPP library. | ||
create_dir: TRUE |
59 changes: 59 additions & 0 deletions
59
inst/rmarkdown/templates/template-eppexist_es/skeleton/skeleton.Rmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
title: "Titulo del reporte" | ||
author: "Tu nombre" | ||
date: "`r format(Sys.time(), '%d de %B, %Y')`" | ||
output: output_format | ||
bibliography: skeleton.bib | ||
link-citations: yes | ||
header-includes: | ||
- \usepackage[utf8]{inputenc} | ||
- \usepackage[spanish]{babel} | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(echo = TRUE) | ||
require(EPP); library(ggplot2) | ||
centers <- centers_epp # Inlcuye aqui tu data.frame con información de los centros de atención. | ||
pop <- pop_epp # Inlcuye aqui tu data.frame con información de la población a cubrir. | ||
var_of_weight <- "ICC" # Nombre de la variable usada como "weight". | ||
# Incluye aquí otros parametros que ajusten a tu caso | ||
# n <- 3 # Numero total de iteraciones con la distancia "d1". | ||
# m <- 0 # Numero total de iteraciones considerando dos distancias de radio de acción de los centros. | ||
# d1 <- 1000 # Radio en metros que cada centro cubre en las primeras "n" iteraciones. | ||
# d2 <- 2000 # Radio en metros que cada centro cubre en las últimas "m" - "n" iteracions. | ||
crs <- sp::CRS("+init=epsg:32721") # Sistema de Coordenadas de Referencia (CRS). | ||
``` | ||
|
||
## Inputs | ||
|
||
Este reporte presenta la evaluación de cobertura de `r nrow(centers)` centros, y la cobertura por proximidad de `r nrow(pop)` individuos que presentan una media de `r var_of_weight` equivalente a `r mean(pop$weight)`. | ||
|
||
## Outputs | ||
|
||
```{r} | ||
exist <- eppexist(pop = pop, centers = centers, crs = crs) | ||
``` | ||
|
||
La población que no pudo ser cubierta corresponde a `r nrow(exist$pop_uncover)` casos, con una media de `r var_of_weight` equivalente a `r mean(exist$pop_uncover$weight)`. | ||
|
||
Por su parte la población asignada a sus correspondientes centros fue de `r nrow(exist$pop_assigned)` casos, con una media de | ||
`r var_of_weight` equivalente a `r mean(exist$pop_assigned$weight)`. | ||
|
||
```{r} | ||
ggplot(exist$pop_assigned, aes(x = id, y = weight, color = iteration)) + | ||
geom_point(size=6) | ||
``` | ||
|
||
Desde el punto de los centros, veamos la capacidad no utilizada después del procesamiento, para evaluar que centros hay que analizar por exceso de oferta de cupos. | ||
|
||
```{r} | ||
ggplot(exist$remaining_capacity, aes(x = id, y = capacity)) + | ||
geom_point(size=6) | ||
``` | ||
|
||
# Bibliography | ||
|
||
```{r bib, include=FALSE} | ||
# crea un archivo bib con todos los paquetes usados en este documento | ||
knitr::write_bib(c('base', 'rmarkdown', 'EPP'), file = 'skeleton.bib') | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: Template eppexist_es | ||
description: > | ||
Este template ayuda con la descripción de los resultados que se obtienen con la función eppexist del paquete EPP en español. | ||
create_dir: TRUE |