Skip to content

Commit

Permalink
Fix bug #147 (#148)
Browse files Browse the repository at this point in the history
* Fix bug #147

* Style updates
  • Loading branch information
juan-umana authored Sep 17, 2024
1 parent edccf86 commit 314a35f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 41 deletions.
2 changes: 1 addition & 1 deletion R/demographics.R
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ age_risk <- function(age, population_pyramid, sex = NULL, plot = FALSE) {
) +
# nolint start
ggplot2::ylab(tr_("Cases / Population"))
# nolint end
# nolint end
}
print(age_risk_plot)
return(list(data = age_risk, plot = age_risk_plot))
Expand Down
14 changes: 11 additions & 3 deletions R/endemic_channel.R
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ endemic_plot <- function(channel_data, method,
expand = c(0.01, 0.01)
)

if (anyNA(channel_data$obs)) {
if (all(is.na(channel_data$obs))) {
endemic_channel_plot <- endemic_channel_plot +
ggplot2::scale_color_manual(
name = "",
Expand All @@ -364,11 +364,19 @@ endemic_plot <- function(channel_data, method,
)
} else {
endemic_channel_plot <- endemic_channel_plot +
ggplot2::geom_line(ggplot2::aes(y = .data$obs, color = "Observed cases"),
ggplot2::geom_line(
ggplot2::aes(
y = .data$obs,
color = tr_("Observed cases")
),
linetype = "dashed",
linewidth = 0.75
) +
ggplot2::geom_point(ggplot2::aes(y = .data$obs, color = "Observed cases"),
ggplot2::geom_point(
ggplot2::aes(
y = .data$obs,
color = tr_("Observed cases")
),
size = 2
) +
ggplot2::scale_color_manual(
Expand Down
34 changes: 17 additions & 17 deletions epiCo.Rproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
20 changes: 10 additions & 10 deletions po/R-epiCo.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: epiCo 1.0.0\n"
"POT-Creation-Date: 2024-09-16 14:18-0500\n"
"POT-Creation-Date: 2024-09-16 16:14-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -102,39 +102,39 @@ msgstr ""
msgid "relationship"
msgstr ""

#: endemic_channel.R:320
#: endemic_channel.R:319
msgid "Endemic channel"
msgstr ""

#: endemic_channel.R:323
#: endemic_channel.R:322
msgid "Method: %s | Epidemic years: %s are %s"
msgstr ""

#: endemic_channel.R:329
#: endemic_channel.R:328
msgid "Method: %s | Epidemic year: %s is %s"
msgstr ""

#: endemic_channel.R:336
#: endemic_channel.R:335
msgid "Epidemiological week"
msgstr ""

#: endemic_channel.R:337
#: endemic_channel.R:336
msgid "Number of cases"
msgstr ""

#: endemic_channel.R:359 endemic_channel.R:378
#: endemic_channel.R:358 endemic_channel.R:377
msgid "Epidemic"
msgstr ""

#: endemic_channel.R:359 endemic_channel.R:379
#: endemic_channel.R:358 endemic_channel.R:378
msgid "Warning"
msgstr ""

#: endemic_channel.R:359 endemic_channel.R:380
#: endemic_channel.R:358 endemic_channel.R:379
msgid "Safety"
msgstr ""

#: endemic_channel.R:381
#: endemic_channel.R:367 endemic_channel.R:371 endemic_channel.R:380
msgid "Observed cases"
msgstr ""

Expand Down
20 changes: 10 additions & 10 deletions po/R-es.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: epiCo 1.0.0\n"
"POT-Creation-Date: 2024-09-16 14:18-0500\n"
"POT-Creation-Date: 2024-09-16 16:14-0500\n"
"PO-Revision-Date: 2024-07-31 10:09+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
Expand Down Expand Up @@ -108,39 +108,39 @@ msgstr "tienen sus propias tradiciones y costumbre dentro de la relacion"
msgid "relationship"
msgstr "campo-poblado"

#: endemic_channel.R:320
#: endemic_channel.R:319
msgid "Endemic channel"
msgstr "Canal endémico"

#: endemic_channel.R:323
#: endemic_channel.R:322
msgid "Method: %s | Epidemic years: %s are %s"
msgstr "Método: %s | Años epidémicos: %s son %s"

#: endemic_channel.R:329
#: endemic_channel.R:328
msgid "Method: %s | Epidemic year: %s is %s"
msgstr "Método: %s | Año epidémico: %s es %s"

#: endemic_channel.R:336
#: endemic_channel.R:335
msgid "Epidemiological week"
msgstr "Semana epidemiológica"

#: endemic_channel.R:337
#: endemic_channel.R:336
msgid "Number of cases"
msgstr "Número de casos"

#: endemic_channel.R:359 endemic_channel.R:378
#: endemic_channel.R:358 endemic_channel.R:377
msgid "Epidemic"
msgstr "Epidemia"

#: endemic_channel.R:359 endemic_channel.R:379
#: endemic_channel.R:358 endemic_channel.R:378
msgid "Warning"
msgstr "Alerta"

#: endemic_channel.R:359 endemic_channel.R:380
#: endemic_channel.R:358 endemic_channel.R:379
msgid "Safety"
msgstr "Seguridad"

#: endemic_channel.R:381
#: endemic_channel.R:367 endemic_channel.R:371 endemic_channel.R:380
msgid "Observed cases"
msgstr "Casos observados"

Expand Down

0 comments on commit 314a35f

Please sign in to comment.