1.Introduction to coronavirus

this is my coronavirus document for Japan.coronavirus are a large family of viruses that are known to cause illness ranging from the common cold to more severe diseases. so this report make to find how this virus distributed around the world.

library(coronavirus)
data(coronavirus)
head(coronavirus)
##         date province     country lat long      type cases
## 1 2020-01-22          Afghanistan  33   65 confirmed     0
## 2 2020-01-23          Afghanistan  33   65 confirmed     0
## 3 2020-01-24          Afghanistan  33   65 confirmed     0
## 4 2020-01-25          Afghanistan  33   65 confirmed     0
## 5 2020-01-26          Afghanistan  33   65 confirmed     0
## 6 2020-01-27          Afghanistan  33   65 confirmed     0
tail(coronavirus)
##             date province country     lat     long      type cases
## 87803 2020-05-07 Zhejiang   China 29.1832 120.0934 recovered     0
## 87804 2020-05-08 Zhejiang   China 29.1832 120.0934 recovered     0
## 87805 2020-05-09 Zhejiang   China 29.1832 120.0934 recovered     0
## 87806 2020-05-10 Zhejiang   China 29.1832 120.0934 recovered     0
## 87807 2020-05-11 Zhejiang   China 29.1832 120.0934 recovered     0
## 87808 2020-05-12 Zhejiang   China 29.1832 120.0934 recovered     0
unique(coronavirus$country)
##   [1] "Afghanistan"                      "Albania"                         
##   [3] "Algeria"                          "Andorra"                         
##   [5] "Angola"                           "Antigua and Barbuda"             
##   [7] "Argentina"                        "Armenia"                         
##   [9] "Austria"                          "Azerbaijan"                      
##  [11] "Bahamas"                          "Bahrain"                         
##  [13] "Bangladesh"                       "Barbados"                        
##  [15] "Belarus"                          "Belgium"                         
##  [17] "Belize"                           "Benin"                           
##  [19] "Bhutan"                           "Bolivia"                         
##  [21] "Bosnia and Herzegovina"           "Botswana"                        
##  [23] "Brazil"                           "Brunei"                          
##  [25] "Bulgaria"                         "Burkina Faso"                    
##  [27] "Burma"                            "Burundi"                         
##  [29] "Cabo Verde"                       "Cambodia"                        
##  [31] "Cameroon"                         "Central African Republic"        
##  [33] "Chad"                             "Chile"                           
##  [35] "Colombia"                         "Comoros"                         
##  [37] "Congo (Brazzaville)"              "Congo (Kinshasa)"                
##  [39] "Costa Rica"                       "Cote d'Ivoire"                   
##  [41] "Croatia"                          "Cuba"                            
##  [43] "Cyprus"                           "Czechia"                         
##  [45] "Denmark"                          "Diamond Princess"                
##  [47] "Djibouti"                         "Dominica"                        
##  [49] "Dominican Republic"               "Ecuador"                         
##  [51] "Egypt"                            "El Salvador"                     
##  [53] "Equatorial Guinea"                "Eritrea"                         
##  [55] "Estonia"                          "Eswatini"                        
##  [57] "Ethiopia"                         "Fiji"                            
##  [59] "Finland"                          "France"                          
##  [61] "Gabon"                            "Gambia"                          
##  [63] "Georgia"                          "Germany"                         
##  [65] "Ghana"                            "Greece"                          
##  [67] "Grenada"                          "Guatemala"                       
##  [69] "Guinea"                           "Guinea-Bissau"                   
##  [71] "Guyana"                           "Haiti"                           
##  [73] "Holy See"                         "Honduras"                        
##  [75] "Hungary"                          "Iceland"                         
##  [77] "India"                            "Indonesia"                       
##  [79] "Iran"                             "Iraq"                            
##  [81] "Ireland"                          "Israel"                          
##  [83] "Italy"                            "Jamaica"                         
##  [85] "Japan"                            "Jordan"                          
##  [87] "Kazakhstan"                       "Kenya"                           
##  [89] "Korea, South"                     "Kosovo"                          
##  [91] "Kuwait"                           "Kyrgyzstan"                      
##  [93] "Laos"                             "Latvia"                          
##  [95] "Lebanon"                          "Liberia"                         
##  [97] "Libya"                            "Liechtenstein"                   
##  [99] "Lithuania"                        "Luxembourg"                      
## [101] "Madagascar"                       "Malawi"                          
## [103] "Malaysia"                         "Maldives"                        
## [105] "Mali"                             "Malta"                           
## [107] "Mauritania"                       "Mauritius"                       
## [109] "Mexico"                           "Moldova"                         
## [111] "Monaco"                           "Mongolia"                        
## [113] "Montenegro"                       "Morocco"                         
## [115] "Mozambique"                       "MS Zaandam"                      
## [117] "Namibia"                          "Nepal"                           
## [119] "Netherlands"                      "New Zealand"                     
## [121] "Nicaragua"                        "Niger"                           
## [123] "Nigeria"                          "North Macedonia"                 
## [125] "Norway"                           "Oman"                            
## [127] "Pakistan"                         "Panama"                          
## [129] "Papua New Guinea"                 "Paraguay"                        
## [131] "Peru"                             "Philippines"                     
## [133] "Poland"                           "Portugal"                        
## [135] "Qatar"                            "Romania"                         
## [137] "Russia"                           "Rwanda"                          
## [139] "Saint Kitts and Nevis"            "Saint Lucia"                     
## [141] "Saint Vincent and the Grenadines" "San Marino"                      
## [143] "Sao Tome and Principe"            "Saudi Arabia"                    
## [145] "Senegal"                          "Serbia"                          
## [147] "Seychelles"                       "Sierra Leone"                    
## [149] "Singapore"                        "Slovakia"                        
## [151] "Slovenia"                         "Somalia"                         
## [153] "South Africa"                     "South Sudan"                     
## [155] "Spain"                            "Sri Lanka"                       
## [157] "Sudan"                            "Suriname"                        
## [159] "Sweden"                           "Switzerland"                     
## [161] "Syria"                            "Taiwan*"                         
## [163] "Tajikistan"                       "Tanzania"                        
## [165] "Thailand"                         "Timor-Leste"                     
## [167] "Togo"                             "Trinidad and Tobago"             
## [169] "Tunisia"                          "Turkey"                          
## [171] "Uganda"                           "Ukraine"                         
## [173] "United Arab Emirates"             "United Kingdom"                  
## [175] "Uruguay"                          "US"                              
## [177] "Uzbekistan"                       "Venezuela"                       
## [179] "Vietnam"                          "West Bank and Gaza"              
## [181] "Western Sahara"                   "Yemen"                           
## [183] "Zambia"                           "Zimbabwe"                        
## [185] "Canada"                           "China"                           
## [187] "Australia"
library(tidyverse)
## -- Attaching packages ---------------------------------------------------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.2     v purrr   0.3.4
## v tibble  3.0.3     v dplyr   1.0.0
## v tidyr   1.1.0     v stringr 1.4.0
## v readr   1.3.1     v forcats 0.5.0
## -- Conflicts ------------------------------------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(magrittr)
## 
## Attaching package: 'magrittr'
## The following object is masked from 'package:purrr':
## 
##     set_names
## The following object is masked from 'package:tidyr':
## 
##     extract
japan_corona <- coronavirus %>% filter(country == "Japan")
recover_japan_corona <- japan_corona %>% filter(type == "recovered")
head(recover_japan_corona)
##         date province country lat long      type cases
## 1 2020-01-22            Japan  36  138 recovered     0
## 2 2020-01-23            Japan  36  138 recovered     0
## 3 2020-01-24            Japan  36  138 recovered     0
## 4 2020-01-25            Japan  36  138 recovered     0
## 5 2020-01-26            Japan  36  138 recovered     1
## 6 2020-01-27            Japan  36  138 recovered     0
death_japan_corona <- japan_corona %>% filter(type == "death")
head(death_japan_corona)
##         date province country lat long  type cases
## 1 2020-01-22            Japan  36  138 death     0
## 2 2020-01-23            Japan  36  138 death     0
## 3 2020-01-24            Japan  36  138 death     0
## 4 2020-01-25            Japan  36  138 death     0
## 5 2020-01-26            Japan  36  138 death     0
## 6 2020-01-27            Japan  36  138 death     0
confirm_japan_corona <- japan_corona %>% filter(type == "confirmed")
head(confirm_japan_corona)
##         date province country lat long      type cases
## 1 2020-01-22            Japan  36  138 confirmed     2
## 2 2020-01-23            Japan  36  138 confirmed     0
## 3 2020-01-24            Japan  36  138 confirmed     0
## 4 2020-01-25            Japan  36  138 confirmed     0
## 5 2020-01-26            Japan  36  138 confirmed     2
## 6 2020-01-27            Japan  36  138 confirmed     0
ggplot(recover_japan_corona,aes(x=date, y=cases)) + geom_line()+ ggtitle("Japan:Daily covid 19 recoveries")

ggplot(death_japan_corona,aes(x=date, y=cases)) + geom_line()+ ggtitle("Japan:Daily covid 19 deaths")

ggplot(confirm_japan_corona,aes(x=date, y=cases)) + geom_line()+ ggtitle("Japan:Daily covid 19 confimed")

visualization of location

library(ggplot2)
library(maptools)
## Loading required package: sp
## Checking rgeos availability: FALSE
##      Note: when rgeos is not available, polygon geometry     computations in maptools depend on gpclib,
##      which has a restricted licence. It is disabled by default;
##      to enable gpclib, type gpclibPermit()
library(tibble)
library(tidyverse)
library(ggrepel)
library(png)
library(grid)
library(sp)
data(wrld_simpl)
p<- ggplot() +
  geom_polygon(
    data = wrld_simpl,
    aes(x = long, y= lat, group=group), fill ="gray", colour="white"
  ) +
  coord_cartesian(xlim = c(-180,180), ylim = c(-90,90)) +
  scale_x_continuous(breaks = seq(-180,180,120))+
  scale_y_continuous(breaks = seq(-90,90,100))
## Regions defined for each Polygons
p +
  geom_point(
    data = japan_corona, aes(x=long, y=lat), color = "red",size
    =1
  )

Japan comprises 6,852 islands extending along the pacific coast of Asia.It stretches over 3,000 km northeast-southwest from the sea of Okhotsk to the East china and Philippine seas. The country’s five main islands, from north to south, are Hokkaido, Honshu, Shikoku,Kyushu, and Okinawa.

climate condition of Japan

Japan has four distinct seasons with a climate ranging from subarctic in the north to subtropical in the south. conditions are different between the pacific side and the sea of Japan side.Eastern Japan has hot and humid summers and cold winters with very heavy snow on the sea of Japan side and in mountainous areas.

lockdown status of Japan

As COVID-19 deaths have soared into the tens of thousands in some European nations and over 100,000 in the United States, the count was less than 1,000 in Japan as of early July, a remarkably low number among group of 7 countries, despite Japan’s aging society and the large high risk ratio of it’s population.prime minister Shinzo Abe has declared a state of emegency in Tokyo and six other hard-hit Japanese prefectures to 45 the fight against the coronavirus outbreak. but this is no European or Wuhan- style lockdown.some Tokyo residents drew criticism for rushing to escape from Tokyo to the countryside.

Actions taken by the Japan’s government

On April 7,2020, the government decided upon the emergency economic measures for response to COVID-19 to protect the lives and lifestyles of the public and move toward economic recovery (revised on April 20,2020). On April 30, the first supplementary budget for FY2020 to implement those measures was enacted by the Diet. On June 12, 2020, the second supplemntary budget for FY2020, which aims at enhancing the government’s measures to protect the lives and lifestyles of the public from COVID-19 and move forward economic rocovery, was also enacted by the diet.

  1. Exploratory data analysis
head(japan_corona)
##         date province country lat long      type cases
## 1 2020-01-22            Japan  36  138 confirmed     2
## 2 2020-01-23            Japan  36  138 confirmed     0
## 3 2020-01-24            Japan  36  138 confirmed     0
## 4 2020-01-25            Japan  36  138 confirmed     0
## 5 2020-01-26            Japan  36  138 confirmed     2
## 6 2020-01-27            Japan  36  138 confirmed     0
summary(japan_corona)
##       date              province           country               lat    
##  Min.   :2020-01-22   Length:336         Length:336         Min.   :36  
##  1st Qu.:2020-02-18   Class :character   Class :character   1st Qu.:36  
##  Median :2020-03-17   Mode  :character   Mode  :character   Median :36  
##  Mean   :2020-03-17                                         Mean   :36  
##  3rd Qu.:2020-04-14                                         3rd Qu.:36  
##  Max.   :2020-05-12                                         Max.   :36  
##       long         type               cases        
##  Min.   :138   Length:336         Min.   :-417.00  
##  1st Qu.:138   Class :character   1st Qu.:   0.00  
##  Median :138   Mode  :character   Median :   5.00  
##  Mean   :138                      Mean   :  74.87  
##  3rd Qu.:138                      3rd Qu.:  42.50  
##  Max.   :138                      Max.   :2221.00

Data description

Description:-Daily summary of the Coronavirus (COVID-19) cases by state/province.

Usage:-coronavirus

Format:-A data frame with 7 variables.

date:-Date in YYYY-MM-DD format.

province:-Name of province/state, for countries where data is provided split across multiple provinces/states.

country:-Name of country/region.

lat:-Latitude of center of geographic region, defined as either country or, if available, province.

long:-Longitude of center of geographic region, defined as either country or, if available, province.

type:-An indicator for the type of cases (confirmed, death, recovered).

cases:-Number of cases on given date.

Details:-The dataset contains the daily summary of Coronavirus cases (confirmed, death, and recovered), by state/province.

Source:-Johns Hopkins University Center for Systems Science and Engineering (JHU CCSE) Coronavirus website.

smp_size <- 270
## set the seed to make your partition reproducible
set.seed(123)
train_ind <- sample(seq_len(nrow(japan_corona)), size=smp_size)
train <- japan_corona[train_ind, ]
dim(train)
## [1] 270   7
test <-japan_corona[-train_ind, ]
dim(test)
## [1] 66  7
head(train)
##           date province country lat long      type cases
## 179 2020-03-28            Japan  36  138     death     3
## 14  2020-02-04            Japan  36  138 confirmed     2
## 195 2020-04-13            Japan  36  138     death    15
## 306 2020-04-12            Japan  36  138 recovered     0
## 118 2020-01-27            Japan  36  138     death     0
## 299 2020-04-05            Japan  36  138 recovered     0
Japan_corona_1<-train %>%  
  pivot_longer(c(7), names_to="variable", values_to="value")
Japan_corona_1
## # A tibble: 270 x 8
##    date       province country   lat  long type      variable value
##    <date>     <chr>    <chr>   <dbl> <dbl> <chr>     <chr>    <int>
##  1 2020-03-28 ""       Japan      36   138 death     cases        3
##  2 2020-02-04 ""       Japan      36   138 confirmed cases        2
##  3 2020-04-13 ""       Japan      36   138 death     cases       15
##  4 2020-04-12 ""       Japan      36   138 recovered cases        0
##  5 2020-01-27 ""       Japan      36   138 death     cases        0
##  6 2020-04-05 ""       Japan      36   138 recovered cases        0
##  7 2020-01-26 ""       Japan      36   138 recovered cases        1
##  8 2020-02-10 ""       Japan      36   138 recovered cases        3
##  9 2020-05-11 ""       Japan      36   138 recovered cases      166
## 10 2020-03-02 ""       Japan      36   138 death     cases        0
## # ... with 260 more rows
ggplot(Japan_corona_1,aes(x=value))+geom_histogram()+
  facet_wrap(variable ~.,ncol=1)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(Japan_corona_1,aes(x=value))+geom_histogram(colour="white")+
  facet_wrap(variable ~.,ncol=1, scales="free")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(Japan_corona_1,aes(x=value, fill=variable))+geom_density()+
  facet_wrap(variable ~.,ncol=1, scales="free")

ggplot(Japan_corona_1,aes(y=value, x=type, fill=type))+geom_boxplot()+
  facet_wrap(variable ~.,ncol=1, scales="free")

ggplot(Japan_corona_1,aes(x=value, y=type, fill=type))+geom_boxplot()+
  facet_wrap(variable ~.,ncol=1, scales="free")

ggplot(recover_japan_corona,aes(x=cases))+geom_histogram()+
  facet_wrap(type ~.,ncol=1, scales="free")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(death_japan_corona,aes(x=cases))+geom_histogram()+
  facet_wrap(type ~.,ncol=1, scales="free")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(confirm_japan_corona,aes(x=cases))+geom_histogram()+
  facet_wrap(type ~.,ncol=1, scales="free")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(recover_japan_corona,aes(x=date, y=cases)) + geom_line()+ ggtitle("Japan recovery:Daily covid 19")

ggplot(death_japan_corona,aes(x=date, y=cases)) + geom_line()+ ggtitle("Japan deaths:Daily covid 19")

ggplot(confirm_japan_corona,aes(x=date, y=cases)) + geom_line()+ ggtitle("Japan confirm:Daily covid 19")

comparison with Italy

Italy_corona <- coronavirus %>% filter(country == "Italy")
head(Italy_corona)
##         date province country lat long      type cases
## 1 2020-01-22            Italy  43   12 confirmed     0
## 2 2020-01-23            Italy  43   12 confirmed     0
## 3 2020-01-24            Italy  43   12 confirmed     0
## 4 2020-01-25            Italy  43   12 confirmed     0
## 5 2020-01-26            Italy  43   12 confirmed     0
## 6 2020-01-27            Italy  43   12 confirmed     0
ggplot(Italy_corona,aes(x=date, y=cases)) + geom_line()+ ggtitle("Italy:Daily covid 19")

summary(Italy_corona)
##       date              province           country               lat    
##  Min.   :2020-01-22   Length:336         Length:336         Min.   :43  
##  1st Qu.:2020-02-18   Class :character   Class :character   1st Qu.:43  
##  Median :2020-03-17   Mode  :character   Mode  :character   Median :43  
##  Mean   :2020-03-17                                         Mean   :43  
##  3rd Qu.:2020-04-14                                         3rd Qu.:43  
##  Max.   :2020-05-12                                         Max.   :43  
##       long        type               cases     
##  Min.   :12   Length:336         Min.   :  -1  
##  1st Qu.:12   Class :character   1st Qu.:   0  
##  Median :12   Mode  :character   Median : 404  
##  Mean   :12                      Mean   :1075  
##  3rd Qu.:12                      3rd Qu.:1640  
##  Max.   :12                      Max.   :8014

comparison with south korea

Korea_South_corona <- coronavirus %>% filter(country == "Korea, South")
head(Korea_South_corona)
##         date province      country lat long      type cases
## 1 2020-01-22          Korea, South  36  128 confirmed     1
## 2 2020-01-23          Korea, South  36  128 confirmed     0
## 3 2020-01-24          Korea, South  36  128 confirmed     1
## 4 2020-01-25          Korea, South  36  128 confirmed     0
## 5 2020-01-26          Korea, South  36  128 confirmed     1
## 6 2020-01-27          Korea, South  36  128 confirmed     1
ggplot(Korea_South_corona,aes(x=date, y=cases)) + geom_line()+ ggtitle("Korea_south:Daily covid 19")

summary(Korea_South_corona)
##       date              province           country               lat    
##  Min.   :2020-01-22   Length:336         Length:336         Min.   :36  
##  1st Qu.:2020-02-18   Class :character   Class :character   1st Qu.:36  
##  Median :2020-03-17   Mode  :character   Mode  :character   Median :36  
##  Mean   :2020-03-17                                         Mean   :36  
##  3rd Qu.:2020-04-14                                         3rd Qu.:36  
##  Max.   :2020-05-12                                         Max.   :36  
##       long         type               cases        
##  Min.   :128   Length:336         Min.   : -17.00  
##  1st Qu.:128   Class :character   1st Qu.:   0.00  
##  Median :128   Mode  :character   Median :   4.00  
##  Mean   :128                      Mean   :  62.25  
##  3rd Qu.:128                      3rd Qu.:  73.25  
##  Max.   :128                      Max.   :1369.00
  1. Conclusions and Discussion

there are 187 countries in our project.I have taken country Japan for my visualisation.Japan comprises 6,852 islands extending along the pacific coast of Asia.It stretches over 3,000 km northeast-southwest from the sea of Okhotsk to the East china and Philippine seas. The country’s five main islands, from north to south, are Hokkaido, Honshu, Shikoku,Kyushu, and Okinawa. there are 3 types of cases can find in every country. there are confirmed, recovered and death cases.In Japan since January to may months there is a high increase in may month of recovery cases. Also there is a increasing pattern since march to may months in death cases and in confirmed cases there is a increase since march to may minths. there are 7 variables to visualise our data. there are date, province, country, lat, long, type and cases. I have given 270 data for my training set so my testing det has 80 data. the data visualise from 2020-01-22 to 2020-05-12 and between these two dates there are 74.87 mean number of cases.maximum number of cases are 2221. median number of cases are 5. the maximum number of cases were distributed in 138 mean longtude and in 36 mean latitude. coronavirus distributed Jan to May in 138 maximum longtude and maximum lattitude is 36. In the density plot, it shows large peak at the beginning of coronavirus and then it decreased. when plot histograms for death, recovered and confirmed typrs of cases, those 3 plots shows large number of cases at the beginning and after that it shows decrease pattern. south korea is a nearest country to Japan. so when got summary of south korea cases there are 1369 maximum number of cases and mean number of cases are 6225. it is lower than to japan. so coronavirus has distributed around Japan than to South korea.covid 19 distributed around 128 longtude in South korea. It is lower than to Japan and lattitude of south korea is same to Japan. Italy reported lot of coronavirus cases than other countries some times.so when summarize it’s data to compare with japan there are 8014 number of peoples identified. it is very large number when compare with Japan. mean number of cases also higher than to Japan. it is 1075. so we can conclude that, Italy faced to very difficult situation in this months.