Commit efa3e64a authored by Renaud Lancelot's avatar Renaud Lancelot 🌍
Browse files

Updated version of the European template: need to esape '\%' when used in...

Updated version of the European template: need to esape '\%' when used in strings which are later processed with R ('\\%').
parent 586903b4
Pipeline #13951 passed with stage
in 8 minutes and 31 seconds
......@@ -830,10 +830,10 @@ labcol1 <- paste("`d2peak`: time lag (d) from 1st death to the mortality peak;",
"`maxdr`: daily mortality rate at the first daily mortality peak",
" (death number / 100,000 ind.), ",
"`gr11`: mortality growth rate at day 11 after the lockdown;",
"`rgr46`: relative change (%) in fitted mortality",
"`rgr46`: relative change (\\%) in fitted mortality",
"growth rate on d 46 after the lockdown, reported to `gr11`")
capg <- paste(cap1, labcol1, "\n")
capg <- paste(cap1, collapse(labcol1, NA), "\n")
fdat1 <- subset(mydat1,
select = c("d2peak", "maxdr", "gr11", "rgr46"))
......@@ -850,7 +850,6 @@ knitr::kable(fdat1,
align = "r",
caption = capg)
```
\newpage
......@@ -881,8 +880,10 @@ cap <- paste("Daily mortality decay after the mortality",
"peak in Eurpean countries.")
decayL <- na.omit(
melt(data.frame(name = row.names(mydat2),
mydat2)))
reshape2::melt(
data = data.frame(name = row.names(mydat2),
mydat2),
id.vars = "name"))
decayL$decay <- as.numeric(substr(decayL[,2], 2, 3))
names(decayL) <- c("name", "TXX", "time", "decay")
decayL <- decayL[order(decayL$name, decayL$time), ]
......@@ -898,11 +899,9 @@ xyplot(decay ~ time | name, data = decayL,
ylab = list("Mortality decrease (%)", cex = .7),
panel = function(x, y){
panel.grid()
panel.xyplot(x, y,
type = "b",
pch = 21,
col = 1,
fill = "white")
panel.xyplot(x, y, type = "l", col = 1)
lpoints(x, y, pch = 19, col = "white", cex = .9)
lpoints(x, y, pch = 21, col = 1, fill = "white", cex = .7)
})
```
......@@ -914,7 +913,7 @@ xyplot(decay ~ time | name, data = decayL,
(with respect to its level at the peak), in several countries: North
Macedonia (70% of the peak mortality), Poland (60%), Romania (60%),
Sweden (60%), Bosnia and Herzegovina (50%)... Though these countries
had low mortality levels at the peak (except Sweden), and because
had low mortality levels at the peak (except for Sweden), and because
all countries are now way beyond the 46-d threshold after the
lockdown, this is an indication that virus transmission is still
occurring.
......@@ -931,7 +930,7 @@ cap <- paste("Correlation between the mortality indicators",
"scatter plots augmented with a loess-smoothed",
"curve (red line). Under the diagonal: absolute",
"value of the linear correlation coefficient.\n",
labcol1, labcol3, "\n")
collapse(labcol1, NA), labcol3, "\n")
## put (absolute) correlations on the upper panels,
## with size proportional to the correlations.
......@@ -964,9 +963,8 @@ pairs(z,
lower.panel = panel.cor,
gap = 0.5, row1attop = FALSE)
```
\justify
Firstly, we selected variables from these two sets, (i) based on their
......@@ -987,7 +985,7 @@ cap <- paste0(
"Country classes according to the features of their mortality pattern. ",
"A: eigen values of the principal component analysis (PCA); B: ",
"correlation circle (axes 1 (horizontal) and 2 (vertical), ",
"column labels:", collapse(paste(labcol1, labcol2), NA), ";" ,
"column labels:", collapse(labcol1, NA), labcol2, ";" ,
"C: dendrogram of the hierarchical ascending classification with the",
"scores of 1st and 2nd axes of the PCA.\n")
......@@ -1262,6 +1260,7 @@ kable(
```
\justify
\newpage
# Conclusion
......
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