File:Covid-19 incidence by catchment area 1.svg
Original file (SVG file, nominally 450 × 720 pixels, file size: 203 KB)
Captions
Summary
[edit]DescriptionCovid-19 incidence by catchment area 1.svg |
English: Covid-19 incidence by catchment area, weeks 11-12 |
Date | |
Source | Own work |
Author | Merikanto |
SVG development InfoField |
Source od data:
Thl avoin data
Varmistetut koronatapaukset Suomessa (COVID-19)
Rajapinnan osoite: https://sampo.thl.fi/pivot/prod/api/epirapo/covid19case.json
Aineiston aihealue: epirapo
Aineiston nimi: covid19case
- covid-19 cases in Finland by cahchment area
- incidence
-
- R script
-
- uses geofi
-
- 20.6.2021 0000.0001
library(geofi)
library(ggplot2)
library(dplyr)
library(rjstat)
library(stringr)
library(tidyr)
library(svglite)
library(sf)
library(viridis)
vuosi=2021
viikko=11
widthi=5
heighti=8
- widthi=10
- heighti=16
tulosfilee1="Covid-19_cases_by_area_1.svg"
- get THL data
url_base <- "https://sampo.thl.fi/pivot/prod/fi/epirapo/covid19case/fact_epirapo_covid19case.json"
- request <- "?row=hcdmunicipality2020-445268L&column=dateweek20200101-509030"
- request <- "?row=hcd-445268L&column=dateweek20200101-509030"
- https://sampo.thl.fi/pivot/prod/fi/epirapo/covid19case/fact_epirapo_covid19case.json
request<-"?row=hcdmunicipality2020-445222&column=dateweek20200101-509030&filter=measure-444833"
url <- paste0(url_base, request)
cube <- fromJSONstat(url, naming = "label", use_factors = F, silent = T)
res <- cube1
- head(res, 30)
locations00<-res[,1]
times00<-res[,2]
cases00<-strtoi(res[,3])
thl1<-data.frame(locations00,times00,cases00)
- dateweek20200101
- value
- print(locations00)
- print(cases00)
- print (head(locations00))
- stop(-1)
locations11<-locations00[!duplicated(locations00)]
- print(head(locations11))
lenlocations11=length(locations11)
print(lenlocations11)
data_in_specific_week <- data.frame("Location","WeeklyCases")
nn=00
for (locationtosearch in locations11)
{
print(locationtosearch)
allfromlocation=res[grep(locationtosearch, res$hcdmunicipality2020),]
#print(allfromlocation)
#"Vuosi 2021 Viikko 10"
vuosistring=toString(vuosi)
viikkostring=toString(viikko)
#print(vuosistring)
#print(viikkostring)
datestring=paste0("Vuosi ",vuosistring," Viikko ",viikkostring)
#print(head(allfromlocation))
#print(datestring)
selected_time_location=allfromlocation[grep(datestring, allfromlocation$dateweek20200101),]
#print("Allfromlocation")
#print(selected_time_location)
weeklycases=selected_time_location$value
#print("Weekly")
#print(weeklycases)
newdata00 <- rbind(data_in_specific_week, c(locationtosearch, weeklycases))
data_in_specific_week=newdata00
# nn=nn+1
#if(nn>1) break
}
- stop(-1)
- print("Kup")
- print(selected_time_location)
print(data_in_specific_week)
write.csv(data_in_specific_week, "./mini.csv", row.names=T)
- populaation aakkosjärjestys alphap order
sahopivaki<-c(
29789,
128756,
194316,
100226,
1667203,
41060,
73061,
171364,
77689,
252676,
166623,
117350,
61172,
535044,
165569,
409418,
245602,
211215,
218624,
169684,
481478
)
- thldata1<-data.frame(shps1,tapaukset)
thldata1<-data_in_specific_week
names(thldata1)<-c("sairaanhoitop_name_fi","tapaukset")
thldata1$tapaukset<-strtoi(thldata1$tapaukset)
thldata1
d1 <- get_municipalities(year = 2021)
- shpt1 <- d1 %>% group_by(sairaanhoitop_name_fi) %>% count(maakunta_code)
- shpt1 <- d1 %>% group_by(sairaanhoitop_name_fi) %>% count()
shpt1 <- d1 %>% group_by(sairaanhoitop_name_fi) %>% count()
shpt1
- stop(-1)
totaali <- merge(shpt1, thldata1, by="sairaanhoitop_name_fi")
- totaali <- merge(totaali00, savaki1, by="sairaanhoitop_name_fi")
- totaali
totaali$vaesto <- sahopivaki
totaali
- stop(-1)
tapauksia1<-as.double(totaali$tapaukset)
vaesto1<-as.double(totaali$vaesto)
ilmaantuvuus<-tapauksia1*0.0
ilmaantuvuus0<-(100000*tapauksia1)/vaesto1
ilmaantuvuus=round(ilmaantuvuus0, digits = 0)
print("RAKO")
- print(tapauksia1)
- print(vaesto1)
- print(ilmaantuvuus)
- stop(-1)
print (head(totaali, 40))
len1=length(tapauksia1)
totaali$ilmaantuvuus <- ilmaantuvuus
totaali
- stop(-1)
daata1=totaali
my_breaks = c(100,2000,5000,10000,20000,50000, 100000,200000,50000, 100000)
otsikko="Koronatapausten ilmaantuvuus"
alaotsikko=paste0("Tapausta/100000 as, viikot ",toString(viikko), "-", toString(viikko+1), " ",toString(vuosi) )
footeri=""
p2 <- ggplot(daata1, aes(fill = ilmaantuvuus ) ) +
- geom_sf(colour = alpha("white", 1/3)) +
geom_sf()+
geom_sf_text(aes(label = ilmaantuvuus),
size = 7,
face = "bold",
color = "black") +
theme(legend.position = "none")+
# labs(subtitle = "Data")+
## ggtitle(otsikko) +
labs(title = otsikko,
subtitle = alaotsikko,
caption =footeri)+
theme(plot.title = element_text(size = 18, face = "bold")) +
theme(plot.subtitle = element_text(size = 14, face = "bold")) +
theme(plot.caption = element_text(size = 16, face = "bold")) +
theme(axis.text=element_text(size=15),
axis.title=element_text(size=15,face="bold")) +
# theme(legend.key.size = unit(2, 'cm')) +
xlab("Pituusaste")+
ylab("Leveysaste") +
##scale_fill_viridis_c()
scale_fill_viridis_c(
breaks = my_breaks, labels = my_breaks, option = "viridis",
trans = scales::pseudo_log_trans(sigma = 0.001)
)
svg(filename=tulosfilee1, width=widthi, height=heighti, pointsize=12)
p2
dev.off()
Licensing
[edit]- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 11:08, 20 June 2021 | 450 × 720 (203 KB) | Merikanto (talk | contribs) | Correction: year | |
11:05, 20 June 2021 | 450 × 720 (197 KB) | Merikanto (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 360pt |
---|---|
Height | 576pt |