Linkki kotitehtävän lähdekoodiin gitlab:ssa
R:ssä on funktiot käyttöjärjestelmän tiedostojärjestelmän käyttöön, kuten tiedostojen luomiseen (file.create()
) kansioiden luomiseen (dir.create()
).
Kysymys: Millä komennolla luot nykyisen työhakemistoon kansion _kotitehtava2
?
dir.create("./_kotitehtava2")
## Warning in dir.create("./_kotitehtava2"): './_kotitehtava2' already exists
Kysymys: Millä komennolla luot kansioon _kotitehtava2
tiedoston ‘muistiinpanot.txt’?
file.create("./_kotitehtava2/muistiinpanot.txt")
## [1] TRUE
Kysymys: Millä komennolla kopioit kansiossa _kotitehtava2
olevan tiedoston ‘muistiinpanot.txt’ samaan kansioon nimellä ‘muistiinpanot.md’?
file.copy(from = "./_kotitehtava2/muistiinpanot.txt", to = "./_kotitehtava2/muistiinpanot.md")
## [1] FALSE
Tällä kurssilla käsittelemme R:n kymmenistä ellei sadoista datarakenteista ainoastaan vektoreita ja data.frameja (tibblejä)
Kysymys: Millä komennolla luot numeerisen vektorin nimeltä numerot
, jossa on kokonaisluvut väliltä 10 - 20?
numerot <- 10:20
numerot <- c(10,11,12,13,14,15,16,17,18,19,20)
numerot <- seq(c(10), 20, 1)
Kysymys: Millä komennolla luot kirjainvektorin pohjoismaat
(character vector), jonka elementteinä ovat pohjoismaiden nimet suomeksi kirjoitettuna aakkosjärjestyksessä?
pohjoismaat <- c("Suomi","Ruotsi","Norja","Tanska","Islanti")
sort(pohjoismaat, decreasing = FALSE)
## [1] "Islanti" "Norja" "Ruotsi" "Suomi" "Tanska"
pohjoismaat <- sort(c("Suomi","Ruotsi","Norja","Tanska","Islanti"))
pohjoismaat <-c("Islanti","Norja","Ruotsi","Suomi","Tanska")
c("Suomi","Ruotsi","Norja","Tanska","Islanti") %>% sort() -> pohjoismaat
Kysymys: Miten luot pienen data.framen, jossa sarakkeiden niminä ovat etunimi
, sukunimi
,puolue
ja titteli
ja kolmella rivillä hallituspuolueiden puheenjohtajat, joista sarakkeissa vaaditut tiedot. titteli
viittaa siis henkilön ministeripestiin hallituksessa.
data.frame(etunimi = c("Timo","Juha","Petteri"),
sukunimi = c("Soini","Sipilä","Orpo"),
puolue = c("PS","KESK","KOK"),
titteli = c("ulkoministeri","pääministeri","valtiovarainministeri"),
stringsAsFactors = FALSE
)
## etunimi sukunimi puolue titteli
## 1 Timo Soini PS ulkoministeri
## 2 Juha Sipilä KESK pääministeri
## 3 Petteri Orpo KOK valtiovarainministeri
dplyr::data_frame(etunimi = c("Timo","Juha","Petteri"),
sukunimi = c("Soini","Sipilä","Orpo"),
puolue = c("PS","KESK","KOK"),
titteli = c("ulkoministeri","pääministeri","valtiovarainministeri")
)
## # A tibble: 3 × 4
## etunimi sukunimi puolue titteli
## <chr> <chr> <chr> <chr>
## 1 Timo Soini PS ulkoministeri
## 2 Juha Sipilä KESK pääministeri
## 3 Petteri Orpo KOK valtiovarainministeri
Käyttämämme data “Wages and Education of Young Males” löytyy osoitteesta https://vincentarelbundock.github.io/Rdatasets/csv/plm/Males.csv
Kysymys: Miten tallennan ko. tiedoston nimellä males.csv
kansioon _kotitehtava2
?
download.file(url = "https://vincentarelbundock.github.io/Rdatasets/csv/plm/Males.csv",destfile = "./_kotitehtava2/males.csv")
Paikallisessa kansiossa olevan tekstimuotoisen datan tuomiseen käytetään useimmiten read.table()
-funktiota tai mikäli kyseessä on pilkuilla erotettu .csv tiedosto read.csv()
-funktiota. Funktio tarvii argumenteikseen polun tiedostoon path=...
. Lisäksi usein määritellään lisäargumentit kuten header=TRUE/FALSE
, stringsAsFactors=TRUE/FALSE
ja toisinaan FileEncoding="Latin1"
jos käytettävä tiedosto on windowsissa luotu ääkkösiä sisältävä data.
Kysymys: Miten tuot edellisessa vaiheessa tallentamasi tiedoston R:ään funktiolla read.csv()
, jotta objektin nimeksi tulee malesdata
?
malesdata <- read.csv(file = "./_kotitehtava2/males.csv",stringsAsFactors = FALSE)
R:ssä on erilaisia funktioita datan kuvailuun kuten str()
tai summary()
.
Kysymys: Miten saat konsoliin/päätteeseen näkyville äsken lataamasi malesdata
aineiston kuusi ensimmäistä riviä?
head(malesdata)
## X nr year school exper union ethn married health wage
## 1 1 13 1980 14 1 no other no no 1.197540
## 2 2 13 1981 14 2 yes other no no 1.853060
## 3 3 13 1982 14 3 no other no no 1.344462
## 4 4 13 1983 14 4 no other no no 1.433213
## 5 5 13 1984 14 5 no other no no 1.568125
## 6 6 13 1985 14 6 no other no no 1.699891
## industry occupation
## 1 Business_and_Repair_Service Service_Workers
## 2 Personal_Service Service_Workers
## 3 Business_and_Repair_Service Service_Workers
## 4 Business_and_Repair_Service Service_Workers
## 5 Personal_Service Craftsmen, Foremen_and_kindred
## 6 Business_and_Repair_Service Managers, Officials_and_Proprietors
## residence
## 1 north_east
## 2 north_east
## 3 north_east
## 4 north_east
## 5 north_east
## 6 north_east
head(malesdata, n=6)
## X nr year school exper union ethn married health wage
## 1 1 13 1980 14 1 no other no no 1.197540
## 2 2 13 1981 14 2 yes other no no 1.853060
## 3 3 13 1982 14 3 no other no no 1.344462
## 4 4 13 1983 14 4 no other no no 1.433213
## 5 5 13 1984 14 5 no other no no 1.568125
## 6 6 13 1985 14 6 no other no no 1.699891
## industry occupation
## 1 Business_and_Repair_Service Service_Workers
## 2 Personal_Service Service_Workers
## 3 Business_and_Repair_Service Service_Workers
## 4 Business_and_Repair_Service Service_Workers
## 5 Personal_Service Craftsmen, Foremen_and_kindred
## 6 Business_and_Repair_Service Managers, Officials_and_Proprietors
## residence
## 1 north_east
## 2 north_east
## 3 north_east
## 4 north_east
## 5 north_east
## 6 north_east
malesdata[1:6,]
## X nr year school exper union ethn married health wage
## 1 1 13 1980 14 1 no other no no 1.197540
## 2 2 13 1981 14 2 yes other no no 1.853060
## 3 3 13 1982 14 3 no other no no 1.344462
## 4 4 13 1983 14 4 no other no no 1.433213
## 5 5 13 1984 14 5 no other no no 1.568125
## 6 6 13 1985 14 6 no other no no 1.699891
## industry occupation
## 1 Business_and_Repair_Service Service_Workers
## 2 Personal_Service Service_Workers
## 3 Business_and_Repair_Service Service_Workers
## 4 Business_and_Repair_Service Service_Workers
## 5 Personal_Service Craftsmen, Foremen_and_kindred
## 6 Business_and_Repair_Service Managers, Officials_and_Proprietors
## residence
## 1 north_east
## 2 north_east
## 3 north_east
## 4 north_east
## 5 north_east
## 6 north_east
dplyr::slice(malesdata, 1:6)
## X nr year school exper union ethn married health wage
## 1 1 13 1980 14 1 no other no no 1.197540
## 2 2 13 1981 14 2 yes other no no 1.853060
## 3 3 13 1982 14 3 no other no no 1.344462
## 4 4 13 1983 14 4 no other no no 1.433213
## 5 5 13 1984 14 5 no other no no 1.568125
## 6 6 13 1985 14 6 no other no no 1.699891
## industry occupation
## 1 Business_and_Repair_Service Service_Workers
## 2 Personal_Service Service_Workers
## 3 Business_and_Repair_Service Service_Workers
## 4 Business_and_Repair_Service Service_Workers
## 5 Personal_Service Craftsmen, Foremen_and_kindred
## 6 Business_and_Repair_Service Managers, Officials_and_Proprietors
## residence
## 1 north_east
## 2 north_east
## 3 north_east
## 4 north_east
## 5 north_east
## 6 north_east
malesdata %>% dplyr::slice(1:6)
## X nr year school exper union ethn married health wage
## 1 1 13 1980 14 1 no other no no 1.197540
## 2 2 13 1981 14 2 yes other no no 1.853060
## 3 3 13 1982 14 3 no other no no 1.344462
## 4 4 13 1983 14 4 no other no no 1.433213
## 5 5 13 1984 14 5 no other no no 1.568125
## 6 6 13 1985 14 6 no other no no 1.699891
## industry occupation
## 1 Business_and_Repair_Service Service_Workers
## 2 Personal_Service Service_Workers
## 3 Business_and_Repair_Service Service_Workers
## 4 Business_and_Repair_Service Service_Workers
## 5 Personal_Service Craftsmen, Foremen_and_kindred
## 6 Business_and_Repair_Service Managers, Officials_and_Proprietors
## residence
## 1 north_east
## 2 north_east
## 3 north_east
## 4 north_east
## 5 north_east
## 6 north_east
Kysymys: Miten saat konsoliin/päätteeseen näkyville äsken lataamasi malesdata
aineiston muuttujien luokat (class)?
str(malesdata)
## 'data.frame': 4360 obs. of 13 variables:
## $ X : int 1 2 3 4 5 6 7 8 9 10 ...
## $ nr : int 13 13 13 13 13 13 13 13 17 17 ...
## $ year : int 1980 1981 1982 1983 1984 1985 1986 1987 1980 1981 ...
## $ school : int 14 14 14 14 14 14 14 14 13 13 ...
## $ exper : int 1 2 3 4 5 6 7 8 4 5 ...
## $ union : chr "no" "yes" "no" "no" ...
## $ ethn : chr "other" "other" "other" "other" ...
## $ married : chr "no" "no" "no" "no" ...
## $ health : chr "no" "no" "no" "no" ...
## $ wage : num 1.2 1.85 1.34 1.43 1.57 ...
## $ industry : chr "Business_and_Repair_Service" "Personal_Service" "Business_and_Repair_Service" "Business_and_Repair_Service" ...
## $ occupation: chr "Service_Workers" "Service_Workers" "Service_Workers" "Service_Workers" ...
## $ residence : chr "north_east" "north_east" "north_east" "north_east" ...
summary (malesdata)
## X nr year school
## Min. : 1 Min. : 13 Min. :1980 Min. : 3.00
## 1st Qu.:1091 1st Qu.: 2329 1st Qu.:1982 1st Qu.:11.00
## Median :2180 Median : 4569 Median :1984 Median :12.00
## Mean :2180 Mean : 5262 Mean :1984 Mean :11.77
## 3rd Qu.:3270 3rd Qu.: 8406 3rd Qu.:1985 3rd Qu.:12.00
## Max. :4360 Max. :12548 Max. :1987 Max. :16.00
## exper union ethn married
## Min. : 0.000 Length:4360 Length:4360 Length:4360
## 1st Qu.: 4.000 Class :character Class :character Class :character
## Median : 6.000 Mode :character Mode :character Mode :character
## Mean : 6.515
## 3rd Qu.: 9.000
## Max. :18.000
## health wage industry occupation
## Length:4360 Min. :-3.579 Length:4360 Length:4360
## Class :character 1st Qu.: 1.351 Class :character Class :character
## Mode :character Median : 1.671 Mode :character Mode :character
## Mean : 1.649
## 3rd Qu.: 1.991
## Max. : 4.052
## residence
## Length:4360
## Class :character
## Mode :character
##
##
##
colnames(malesdata)
## [1] "X" "nr" "year" "school" "exper"
## [6] "union" "ethn" "married" "health" "wage"
## [11] "industry" "occupation" "residence"
names(malesdata)
## [1] "X" "nr" "year" "school" "exper"
## [6] "union" "ethn" "married" "health" "wage"
## [11] "industry" "occupation" "residence"
lapply(malesdata, class)
## $X
## [1] "integer"
##
## $nr
## [1] "integer"
##
## $year
## [1] "integer"
##
## $school
## [1] "integer"
##
## $exper
## [1] "integer"
##
## $union
## [1] "character"
##
## $ethn
## [1] "character"
##
## $married
## [1] "character"
##
## $health
## [1] "character"
##
## $wage
## [1] "numeric"
##
## $industry
## [1] "character"
##
## $occupation
## [1] "character"
##
## $residence
## [1] "character"
Kysymys: Mikä malesdata
aineiston tapausten syntymävuoden keskiarvo (muuttuja year
)?
mean(malesdata$year)
## [1] 1983.5
# year <- malesdata[,3]; summary(year)
#aggregate(malesdata$year, mean)
Kysymys: Montako uniikkia ammattia (muuttuja occupation
) on datassa malesdata
?
library(tidyverse)
malesdata %>% group_by(occupation) %>% summarise(n=n()) %>% arrange(-n) %>% slice(1) %>% nrow()
length(unique(malesdata$occupation))
summary(malesdata$occupation)
lapply(malesdata, function(x)length(unique(x)))
table(malesdata$occupation) #uniikkeja ei siis yhtään alla olevan koodinpätkän perusteella?, malesdata[malesdataoccupation == 1]
nlevels(malesdata$occupation)
Kysymys: Mikä osuus malesdata
aineiston tapauksista on naimisissa (muuttuja married
)?
malesdata %>% group_by(married) %>% summarise(n=n()) %>% mutate(share = n/sum(n)*100)
prop.table(table(malesdata$married))*100
Datan siivoaminen korostuu sotkuisten “tosielämän” datojen kanssa työskenneltäessä. Meidän data on valmiiksi käsitelty tutkimusdata, jolloin siivoamisen tarve on pienempi. Kuitenkin datassa jossain muuttujissa välilyönnit on korvattu alaviivoilla.
Kysymys: Miten korvaat muuttujien industry
ja occupation
arvojen alaviivat välilyönneiksi?
malesdata$industry <- gsub("_", " ", malesdata$industry)
malesdata$occupation <- gsub("_", " ", malesdata$occupation)
Kysymys: Miten muutat muuttujien industry
ja occupation
kaikki kirjaimet pieniksi?
malesdata$industry <- tolower(malesdata$industry)
malesdata$occupation <- tolower(malesdata$occupation)
Toisinaan tarvit datasta ryhmätason yhteenvetotietoja. dplyr
-paketin group_by
- ja summarise
-funktiot ovat näppäriä tässä.
Kysymys: Kuinka saan ammattiryhmittäiset (muuttuja occupation
) vastaajien määrät sekä ammattiryhmittäiset koulutusvuosien (school´) keskiarvon? Tee tämä yhteenvetodata uudeksi objektiksi
malesdatasum` (käytetään sitä myöhemmin)
malesdata_sum <- malesdata %>% group_by(occupation) %>% summarise(n = n(),
mean_school = mean(school))
malesdata_sum
malesdatasum <- aggregate(x = malesdata$school,by=list(malesdata$occupation), mean)
malesdatasum
library(plyr)
malesdata_sum <- ddply(malesdata,~occupation,summarise,n=table(occupation),mean=mean(school))
malesdata_sum
Kysymys: Ryhmittele malesdata
siten että saat eri teollisuudenalojen (industry
) vuosittaiset palkan keskiarvot. Käytä sitten tidyr-paketin spread-funktiota ja luo datasta leveä versio, joka näyttää tältä
industry | 1980 | 1981 | 1982 | …
———— | —- | —- | —- | …
Agricultural | 1.20 | 1.16 | 1.32 | …
Construction | 1.33 | 1.54 | 1.58 | …
malesdata %>%
select(industry,year,wage) %>%
group_by(industry,year) %>%
dplyr::summarise(wage = mean(wage)) %>%
spread(., key = year, value = wage)
## Source: local data frame [12 x 9]
## Groups: industry [12]
##
## industry `1980` `1981` `1982` `1983`
## * <chr> <dbl> <dbl> <dbl> <dbl>
## 1 agricultural 1.202315 1.1605710 1.3214292 1.299574
## 2 business and repair service 1.316881 1.5179398 1.7195093 1.526883
## 3 construction 1.334668 1.5440904 1.5886381 1.521765
## 4 entertainment 0.794635 0.6789602 0.8135455 1.163240
## 5 finance 1.613188 1.6027791 1.7118051 1.774819
## 6 manufacturing 1.603331 1.6712059 1.6931548 1.754501
## 7 mining 1.110837 1.7427145 1.9233406 2.038914
## 8 personal service 1.106257 1.5331987 1.2891444 1.714600
## 9 professional and related service 1.282575 1.3540691 1.3937525 1.510740
## 10 public administration 1.611905 1.6601698 1.6434656 1.571566
## 11 trade 1.310214 1.3848754 1.4584928 1.518492
## 12 transportation 1.665346 1.8272902 1.8258415 1.904211
## # ... with 4 more variables: `1984` <dbl>, `1985` <dbl>, `1986` <dbl>,
## # `1987` <dbl>
library(tidyr)
library(plyr)
indyr <- ddply(malesdata,~industry~year,summarise, mean(wage))
indyr_long <- reshape(indyr,
timevar = "year",
idvar = "industry",
direction = "wide")
indyr_long
## industry ..1.1980 ..1.1981 ..1.1982 ..1.1983
## 1 agricultural 1.202315 1.1605710 1.3214292 1.299574
## 9 business and repair service 1.316881 1.5179398 1.7195093 1.526883
## 17 construction 1.334668 1.5440904 1.5886381 1.521765
## 25 entertainment 0.794635 0.6789602 0.8135455 1.163240
## 33 finance 1.613188 1.6027791 1.7118051 1.774819
## 41 manufacturing 1.603331 1.6712059 1.6931548 1.754501
## 49 mining 1.110837 1.7427145 1.9233406 2.038914
## 57 personal service 1.106257 1.5331987 1.2891444 1.714600
## 65 professional and related service 1.282575 1.3540691 1.3937525 1.510740
## 73 public administration 1.611905 1.6601698 1.6434656 1.571566
## 81 trade 1.310214 1.3848754 1.4584928 1.518492
## 89 transportation 1.665346 1.8272902 1.8258415 1.904211
## ..1.1984 ..1.1985 ..1.1986 ..1.1987
## 1 1.350324 1.419395 1.262477 1.562929
## 9 1.801290 1.749977 1.693772 1.870127
## 17 1.711789 1.635833 1.798464 1.874879
## 25 1.317049 1.224473 1.499675 1.716047
## 33 1.813426 1.939792 2.052527 2.189296
## 41 1.778711 1.877489 1.854339 1.943431
## 49 1.976985 2.148659 2.061189 2.019210
## 57 1.805545 1.517921 1.700883 1.817869
## 65 1.411012 1.706747 1.860701 1.817023
## 73 1.788067 1.869596 1.840442 1.951527
## 81 1.561313 1.560797 1.684112 1.665668
## 89 1.856471 1.967978 2.013542 1.971387
malesdata %>% # käytetään malesdataa
dplyr::group_by(year, industry) %>% # luokitellaan vuoden ja industryn mukaan
dplyr::summarise(palkka_ka = mean(wage)) -> malesdata # lasketaan keskipalkka
library(tidyr)
wide <- malesdata %>% spread(key="year", value="palkka_ka")
head(wide)
## # A tibble: 6 × 9
## industry `1980` `1981` `1982` `1983`
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 agricultural 1.202315 1.1605710 1.3214292 1.299574
## 2 business and repair service 1.316881 1.5179398 1.7195093 1.526883
## 3 construction 1.334668 1.5440904 1.5886381 1.521765
## 4 entertainment 0.794635 0.6789602 0.8135455 1.163240
## 5 finance 1.613188 1.6027791 1.7118051 1.774819
## 6 manufacturing 1.603331 1.6712059 1.6931548 1.754501
## # ... with 4 more variables: `1984` <dbl>, `1985` <dbl>, `1986` <dbl>,
## # `1987` <dbl>
Aikaisemmassa tehtävässä laadit datan nimeltä malesdatasum
.
Kysymys: Miten piirrät ggplot2
-kirjastolla pylväsdiagrammin, jossa kullekin ammattiryhmälle on tolppansa väritetty vastaajien määrän mukaan ja jossa kunkin ammattiryhmän tolpan pituus vastaa koulutusvuosien keskiarvoa?
malesdata <- read.csv(file = "./_kotitehtava2/males.csv",stringsAsFactors = FALSE)
malesdata_sum <- malesdata %>% group_by(occupation) %>% dplyr::summarise(n = n(),
mean_school = mean(school))
ggplot(malesdata_sum, aes(x=occupation,y=mean_school,fill=n)) + geom_bar(stat="identity")
malesdatasum <- malesdata %>% group_by(occupation) %>% dplyr::summarise(vastaajien_maara = n(),
koulutusvuosien_keskiarvo = mean(school))
library(ggplot2)
p <- ggplot(data=malesdatasum, aes(x=factor(occupation)))
p <- p + geom_bar(aes(y=koulutusvuosien_keskiarvo,fill=vastaajien_maara), stat="identity",position="dodge", col="black")
p <- p + geom_text(data=malesdatasum %>% filter(!is.na(vastaajien_maara)),nudge_y = -.1,
aes(x=factor(occupation),y=koulutusvuosien_keskiarvo,label=paste0(occupation)),
size=4,hjust=1, color="white", angle=90)
p <- p + theme_light()
p <- p + theme(axis.text.x=element_blank())
p <- p + labs(title="Histogrammi eri ammattien koulutusvuosien keskiarvosta")
p <- p + labs(x="Ammatti", y="Koulutusvuosien keskiarvo")
p <- p + labs(fill="vastaajien määrä")
p
Kysymys: *Miten piirrät ggplot2
-kirjastolla viivadiagrammin kustakin vastaajasta, jossa x-akselilla on kokemus (exper
) ja y-akselilla palkka (wage
) ja viivan värin määrä se kuuluuko liittoon (union
)? (Muista määritellä group-parametriksi tapausten id (nr
))
ggplot(malesdata, aes(x=exper,y=wage,group=nr,color=union)) + geom_line()
Kysymys: Jatka edellisen kuvaa niin, jaat vastaajat paneeleihin teollisuudenalan (industry
) mukaan ja lisäät viivaan läpinäkyvyyttä .5 verran?
ggplot(malesdata, aes(x=exper,y=wage,group=nr,color=union)) + geom_line(alpha=.5) + facet_wrap(~industry)
#´# Datan lukeminen R:ään
Kysymys: Maailmanpankki ylläpitää ekseliä, johon on koottu taloudellista eriarvoisuutta kuvaavan gini-indeksin arvoja eri maista eri tutkimusprojekteista. Ekseli sijaitsee täällä: http://siteresources.worldbank.org/INTRES/Resources/469232-1107449512766/allginis_2013.xls - miten luet sen R:ään?
download.file("http://siteresources.worldbank.org/INTRES/Resources/469232-1107449512766/allginis_2013.xls", destfile = "./allginis_2013.xls")
d <- readxl::read_excel("./allginis_2013.xls")
Kysymys: Luennoilla vilkaisimme Tilastokeskuksen rajapintaan. Miten saan pxweb-paketilla Tilastokeskuksesta suomenkielisen taulukon kuntien vuoden 2016 avainluvuista siivottuna Akaan kunnasta Alle 15-vuotiaiden osuuden väestöstä
# library(pxweb)
# # pxweb::interactive_pxweb()
# myDataSetName <-
# get_pxweb_data(url = "http://pxnet2.stat.fi/PXWeb/api/v1/fi/Kuntien_avainluvut/2016/kuntien_avainluvut_2016_viimeisin.px",
# dims = list("Alue 2016" = c('020'),
# Tiedot = c('M391')),
# clean = TRUE)
# myDataSetName
Kysymys: Missä tiedostomuodossa sinun käyttämäsi datat enimmäkseen ovat?
# default_answer(95)
Kysymys: Kenen tiedontuottajan datoihin haluaisin päästä ohjelmallisesti käsiksi?
# default_answer(96)
2016 Markus Kainu.
Tämä teos on lisensoitu Creative Commons Nimeä 4.0 Kansainvälinen -lisenssillä.
Tämä sivusto on tehty R:ssä Rmarkdown-paketin uusimmassa kehitysversion uudella render_site()`
-funktiolla, jonka tekee staattisten responsiivisten verkkosivujen tekemisen helpoksi. Katso ohjeet: