8.1 Capítulo 1

Solução. 1.6

library(coronavirus)
(s <- sum(coronavirus$cases))    # a
## [1] 814351012
(s2 <- sum(coronavirus$cases^2)) # b
## [1] 1.234264e+14
by(coronavirus$cases, coronavirus$type, sum) # c
## coronavirus$type: confirmed
## [1] 676570149
## ------------------------------------------------------------------------------------------------------------------------------------ 
## coronavirus$type: death
## [1] 6881802
## ------------------------------------------------------------------------------------------------------------------------------------ 
## coronavirus$type: recovery
## [1] 130899061
(n <- nrow(coronavirus))
## [1] 973836

d \(\sum_{i=1}^{973836} x_{i} = 8.1435101\times 10^{8}\)

\(\sum_{i=1}^{973836} x_{i}^2 = 1.2342636\times 10^{14}\)

library(lubridate)
today()-min(coronavirus$date) # 2021-08-05
## Time difference of 1685 days