changing explained_variance_ to explained_variance_ratio_

This commit is contained in:
James
2022-01-24 11:02:41 +00:00
parent f30b446110
commit ed87bbdd38
2 changed files with 592 additions and 289 deletions
+6 -4
View File
@@ -7,12 +7,14 @@
library(tidyverse) library(tidyverse)
library(dplyr) library(dplyr)
country_in_question <- "Finland" country_in_question <- "Netherlands"
## World Survey ## World Survey
# matti date range 2021-06-09 to 2022-01-18
# Ask for an indicator that's not found: # Ask for an indicator that's not found:
path <- paste0("https://covidmap.umd.edu/api/resources?indicator=all&type=smoothed&country=", country_in_question, "&daterange=20201115-20201130") path <- paste0("https://covidmap.umd.edu/api/resources?indicator=all&type=smoothed&country=", country_in_question, "&daterange=20210609-20220118")
request <- httr::GET(url = path) request <- httr::GET(url = path)
response <- httr::content(request, as = "text", encoding = "UTF-8") response <- httr::content(request, as = "text", encoding = "UTF-8")
@@ -47,7 +49,7 @@ for (i in 1:length(all_indicators)){
all_indicators[i], all_indicators[i],
"&type=daily&country=", "&type=daily&country=",
country_in_question, country_in_question,
"&daterange=20200101-20221130") "&daterange=20210609-20220118")
# request data from api # request data from api
request <- httr::GET(url = path) request <- httr::GET(url = path)
@@ -102,7 +104,7 @@ latest_date <- data_for_pca$date %>% tail(1)
readr::write_csv(x = data_for_pca, readr::write_csv(x = data_for_pca,
file = paste0("shield-complexity/data/", file = paste0("shield-complexity/data/",
country_in_question, country_in_question,
"_worldsurvey_nonmissing_since_2021-06-08_to_", "_worldsurvey_nonmissing_since_2021-06-09_to_",
latest_date, ".csv")) latest_date, ".csv"))
#### Coefficient of variation #### Coefficient of variation
File diff suppressed because one or more lines are too long