downloadPISA | R Documentation |
Uses an Internet connection to download PISA data to a computer. Data come from the OECD website.
downloadPISA(
root,
years = c(2000, 2003, 2006, 2009, 2012, 2015, 2018),
database = c("INT", "CBA", "FIN"),
cache = FALSE,
verbose = TRUE
)
root |
a character string indicating the directory where the PISA data should be stored. Files are placed in a folder named PISA/[year]. |
years |
an integer vector of the assessment years to download. Valid years are 2000, 2003, 2006, 2009, 2012, 2015, and 2018. |
database |
a character vector to indicate which database to download from. For 2012,
three databases are available ( |
cache |
a logical value set to process and cache the text (.txt) version of files.
This takes a very long time but saves time for future uses of
the data. Default value is |
verbose |
a logical value to either print or suppress status message output.
The default value is |
The function uses
download.file
to download files from provided URLs. Some machines might require a different
user agent in HTTP(S) requests. If the downloading gives an error or behaves
unexpectedly (e.g., a zip file cannot be unzipped or a data file is
significantly smaller than expected), users can toggle HTTPUserAgent
options to find one that works for their machines. One common alternative option is
options(HTTPUserAgent="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0")
Beginning in the 2018 data files, the SPSS_STU_COG.zip
source data file is a DEFLATE64
compressed zip file.
This means that the user must manually extract the contained CY07_MSU_STU_COG.sav
file using an external zip
program capable of handling DEFLATE64
zip format, as existing R functions are unable to handle this zip format natively.
Yuqi Liao, Paul Bailey, and Trang Nguyen
readPISA
, download.file
, options
## Not run:
# download PISA 2012 data (for all three databases)
downloadPISA(years = 2012, database = c("INT","CBA","FIN"), root="~/")
# download PISA 2009, 2012, and 2015 data (International Database only)
# to C:/PISA/2009, C:/PISA/2012, and C:/PISA/2015 folders, respectively
downloadPISA(years = c(2009,2012,2015), root="~/")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.