Last active
October 27, 2022 11:25
-
-
Save sbfnk/f606f396a15360a94029f849afb7ec00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("devtools") | |
library("here") | |
library("socialmixr") | |
redo <- FALSE | |
files_file <- here::here("files.rds") | |
dir.create(here::here("surveys"), showWarnings = FALSE) | |
if (!file.exists(files_file) || redo) { | |
ls <- list_surveys() | |
files <- list() | |
for (url in ls$url) { | |
files[[url]] <- download_survey(url, dir = here::here("surveys")) | |
Sys.sleep(5) | |
} | |
saveRDS(files, files_file) | |
} else { | |
files <- readRDS(files_file) | |
} | |
surveys <- list() | |
for (url in names(files)) { | |
cat(url, "\n" ) | |
surveys[[url]] <- load_survey(files[[url]]) | |
} | |
lapply(surveys, function(x) { | |
message("Participants ", nrow(x$participant), ", Contacts: ", nrow(x$contact)) | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment