Title: | Merge and Download International Large-Scale Assessments (ILSA) Data |
---|---|
Description: | Merges and downloads 'SPSS' data from different International Large-Scale Assessments (ILSA), including: Trends in International Mathematics and Science Study (TIMSS), Progress in International Reading Literacy Study (PIRLS), Programme for International Student Assessment (PISA), and others. |
Authors: | Andrés Christiansen [aut, cre] , Andrés Strello [ctb] |
Maintainer: | Andrés Christiansen <[email protected]> |
License: | GPL (>= 3.0) |
Version: | 1.3.0 |
Built: | 2024-11-26 11:43:25 UTC |
Source: | CRAN |
Add school data to student and teacher files merged by ILSAmerge
.
It will run combineStudents
internally.
To see which ILSA are available for adding school data use availableILSA
.
addSchools(inputdir = getwd(), outputdir = getwd(), quiet = FALSE)
addSchools(inputdir = getwd(), outputdir = getwd(), quiet = FALSE)
inputdir |
a string indicating the path where |
outputdir |
a string indicating where the combined data will be saved. |
quiet |
a logical value indicating if progress status should be
shown. Default is |
Saves combined student data and teacher data with added school data.
# Path where raw 'SPSS' files are input <- system.file("extdata/timssadv", package = "ILSAmerge") # Path where merged files will be saved dir.create(file.path(tempdir(),"addSchools")) output <- file.path(tempdir(),"addSchools") # Merging 'TIMSS' Advanced 1995, as .rds file ILSAmerge(inputdir = input, outputdir = output, filetype = "rds", quiet = FALSE) # Check file names list.files(output,pattern = ".rds") # Add school data addSchools(inputdir = output, outputdir = output) # Check file names list.files(output,pattern = ".rds")
# Path where raw 'SPSS' files are input <- system.file("extdata/timssadv", package = "ILSAmerge") # Path where merged files will be saved dir.create(file.path(tempdir(),"addSchools")) output <- file.path(tempdir(),"addSchools") # Merging 'TIMSS' Advanced 1995, as .rds file ILSAmerge(inputdir = input, outputdir = output, filetype = "rds", quiet = FALSE) # Check file names list.files(output,pattern = ".rds") # Add school data addSchools(inputdir = output, outputdir = output) # Check file names list.files(output,pattern = ".rds")
Checks which 'SPSS' data from different International Large-Scale Assessments (ILSA). are available.
availableILSA( print = TRUE, FOR = c("download", "combine.students", "add.schools", "ILSAready") )
availableILSA( print = TRUE, FOR = c("download", "combine.students", "add.schools", "ILSAready") )
print |
a logical value indicating if results should be printed or not. |
FOR |
a string indicating the availability of ILSA data for different
purposes. Valid strings are |
A list with the names of the ILSA and the available years.
availableILSA(print = TRUE)
availableILSA(print = TRUE)
Combines achievement and background student data merged by ILSAmerge
.
To see which ILSA are available for combining use availableILSA
.
combineStudents(inputdir = getwd(), outputdir = getwd(), quiet = FALSE)
combineStudents(inputdir = getwd(), outputdir = getwd(), quiet = FALSE)
inputdir |
a string indicating the path where |
outputdir |
a string indicating where the combined data will be saved. |
quiet |
a logical value indicating if progress status should be
shown. Default is |
Saves combined student data produced by ILSAmerge
.
# Path where raw 'SPSS' files are input <- system.file("extdata/timssadv", package = "ILSAmerge") # Path where merged files will be saved dir.create(file.path(tempdir(),"combineStudents")) output <- file.path(tempdir(),"combineStudents") # Merging 'TIMSS' Advanced 1995, as .rds file ILSAmerge(inputdir = input, outputdir = output, filetype = "rds", quiet = FALSE) # Rename files ILSArename(output) # Check file names list.files(output,pattern = ".rds") # Combine student files combineStudents(inputdir = output, outputdir = output) # Check file names list.files(output,pattern = ".rds")
# Path where raw 'SPSS' files are input <- system.file("extdata/timssadv", package = "ILSAmerge") # Path where merged files will be saved dir.create(file.path(tempdir(),"combineStudents")) output <- file.path(tempdir(),"combineStudents") # Merging 'TIMSS' Advanced 1995, as .rds file ILSAmerge(inputdir = input, outputdir = output, filetype = "rds", quiet = FALSE) # Rename files ILSArename(output) # Check file names list.files(output,pattern = ".rds") # Combine student files combineStudents(inputdir = output, outputdir = output) # Check file names list.files(output,pattern = ".rds")
Downloads 'SPSS' data from different International Large-Scale Assessments (ILSA). This functions supports the following ILSA: 'PISA', 'TIMSS', 'TIMSS Advanced', 'PIRLS', 'ICCS', 'ICILS', 'CIVED', 'REDS', 'RLII', and 'SITES.' Depending on the study, you will need to decide which data to download, and read and accept its terms and conditions to proceed with the download.
ILSAdownload( study, year, outputdir = getwd(), unzip = FALSE, maxtime = 999, quiet = FALSE, agreeLicense = FALSE )
ILSAdownload( study, year, outputdir = getwd(), unzip = FALSE, maxtime = 999, quiet = FALSE, agreeLicense = FALSE )
study |
a string indicating the name of the study. For available studies check the description of this function. |
year |
a numeric value indicating the year of the study. |
outputdir |
the directory where data will be downloaded. |
unzip |
a logical value indicating if files should be unzipped.
Default is |
maxtime |
a numeric value indicating the maximum time allowed for
downloading a file. Default is |
quiet |
a logical value indicating if progress status should be
shown. If a study has sub-studies, e.g. 'PISA' 2009 and this is |
agreeLicense |
a logical value indicating if you agree with
the Disclaimer and License Agreement file from www.iea.nl. If |
Saves 'SPSS' ILSA data locally.
# For example, to download 'RLII' 1991 data: # Path where files will be saved dir.create(file.path(tempdir(),"ILSAdownload")) output <- file.path(tempdir(),"ILSAdownload") # Downloading 'RLII' 1991 and unzipping files ILSAdownload(study = "RLII", year = 1991, outputdir = output, unzip = TRUE, agreeLicense = TRUE)
# For example, to download 'RLII' 1991 data: # Path where files will be saved dir.create(file.path(tempdir(),"ILSAdownload")) output <- file.path(tempdir(),"ILSAdownload") # Downloading 'RLII' 1991 and unzipping files ILSAdownload(study = "RLII", year = 1991, outputdir = output, unzip = TRUE, agreeLicense = TRUE)
Aggregates International Large-Scale Assessments (ILSA) data files information by population.
ILSAfile.info(inputdir = getwd())
ILSAfile.info(inputdir = getwd())
inputdir |
a string indicating the path where ILSA 'SPSS' files are stored. |
A data frame with the number of files and MBs per population.
# Path where raw 'SPSS' files are input <- system.file("extdata/reds", package = "ILSAmerge") # Get file information ILSAfile.info(inputdir = input)
# Path where raw 'SPSS' files are input <- system.file("extdata/reds", package = "ILSAmerge") # Get file information ILSAfile.info(inputdir = input)
Merges 'SPSS' data from different International Large-Scale Assessments (ILSA). This function has been tested to behave correctly for: 'TIMSS', 'TIMSS Advanced', 'PIRLS', 'ICCS', 'ICILS', 'CIVED', 'REDS', 'RLII', and 'SITES' (2006).
ILSAmerge( inputdir = getwd(), outputdir = getwd(), population = NULL, filetype = c("rds", "zsav", "sav"), MBlimit = NULL, MBlistlimit = 200, SPSSlimit = 50, quiet = FALSE )
ILSAmerge( inputdir = getwd(), outputdir = getwd(), population = NULL, filetype = c("rds", "zsav", "sav"), MBlimit = NULL, MBlistlimit = 200, SPSSlimit = 50, quiet = FALSE )
inputdir |
a string indicating the path where ILSA 'SPSS' files are stored. |
outputdir |
the directory where the merged data will be saved. |
population |
a character vector indicating which files should be merged.
If |
filetype |
a string indicating the type of file to be saved, it can
be |
MBlimit |
a numerical value indicating the allowed limit of the combined
storage of the files of one type (see |
MBlistlimit |
a numerical value indicating the allowed limit of the
combined storage of the files of one type for merging through a list.
Values over the limit will be merged through a matrix, which will be slower
but uses less memory. Default is |
SPSSlimit |
a numerical value indicating the limit of files per command
of 'SPSS', typically |
quiet |
a logical value indicating if progress status should be
shown. Default is |
For files merged within R it will also add country information where needed. Country information will be retrieved from 'GitHub' if possible. If not, it will use the package internal data.
Saves merged ILSA data or .sps
syntax for merging ILSA data.
# Path where raw 'SPSS' files are input <- system.file("extdata/reds", package = "ILSAmerge") # Path where merged files will be saved dir.create(file.path(tempdir(),"ILSAmerge")) output <- file.path(tempdir(),"ILSAmerge") # Merging 'REDS' 2021, as .rds file ILSAmerge(inputdir = input, outputdir = output, filetype = "rds", quiet = FALSE)
# Path where raw 'SPSS' files are input <- system.file("extdata/reds", package = "ILSAmerge") # Path where merged files will be saved dir.create(file.path(tempdir(),"ILSAmerge")) output <- file.path(tempdir(),"ILSAmerge") # Merging 'REDS' 2021, as .rds file ILSAmerge(inputdir = input, outputdir = output, filetype = "rds", quiet = FALSE)
Downloads ILSA data, merges it, combines students and adds school information.
This function is a wrapper for ILSAdownload
, ILSAmerge
,
ILSArename
, combineStudents
, and addSchools
.
To see which ILSA are available for this function use availableILSA
.
If data is already downloaded you can use ILSAreadylocal
.
ILSAready( study, year, outputdir = getwd(), MBlistlimit = 200, quiet = FALSE, agreeLicense = FALSE ) ILSAreadylocal( inputdir = getwd(), outputdir = getwd(), filetype = c("rds", "zsav", "sav"), quiet = FALSE, MBlistlimit = 200 )
ILSAready( study, year, outputdir = getwd(), MBlistlimit = 200, quiet = FALSE, agreeLicense = FALSE ) ILSAreadylocal( inputdir = getwd(), outputdir = getwd(), filetype = c("rds", "zsav", "sav"), quiet = FALSE, MBlistlimit = 200 )
study |
a string indicating the name of the study. For available studies check the description of this function. |
year |
a numeric value indicating the year of the study. |
outputdir |
the directory where the merged data will be saved. |
MBlistlimit |
a numerical value indicating the allowed limit of the
combined storage of the files of one type for merging through a list.
Values over the limit will be merged through a matrix, which will be slower
but uses less memory. Default is |
quiet |
a logical value indicating if progress status should be
shown. Default is |
agreeLicense |
a logical value indicating if you agree with
the Disclaimer and License Agreement file from www.iea.nl. If |
inputdir |
a string indicating the path where ILSA 'SPSS' files are stored. |
filetype |
a string indicating the type of file to be saved, it can
be |
Saves merged and renamed ILSA data.
dir.create(file.path(tempdir(),"timssadv"),showWarnings = FALSE) output <- file.path(tempdir(),"timssadv") input <- system.file("extdata/timssadv", package = "ILSAmerge") ILSAreadylocal(inputdir = input, outputdir = output)
dir.create(file.path(tempdir(),"timssadv"),showWarnings = FALSE) output <- file.path(tempdir(),"timssadv") input <- system.file("extdata/timssadv", package = "ILSAmerge") ILSAreadylocal(inputdir = input, outputdir = output)
ILSAmerge
filesRenames files produced by ILSAmerge
from name codes to comprehensible names
including the study name, year and respondent.
This function has been tested to behave correctly for: 'TIMSS', 'TIMSS Advanced',
'PIRLS', 'ICCS', 'ICILS', 'CIVED', 'REDS', 'RLII', and 'SITES' (2006).
ILSArename( inputdir = getwd(), codeTOname = TRUE, overwrite = TRUE, quiet = FALSE )
ILSArename( inputdir = getwd(), codeTOname = TRUE, overwrite = TRUE, quiet = FALSE )
inputdir |
a string indicating the path where ILSA 'SPSS' files are stored. |
codeTOname |
a logical value indicating if files should be renamed from
codes to names ( |
overwrite |
a logical value indicating if files should be overwritten.
If |
quiet |
a logical value indicating if progress status should be
shown. Default is |
Renames or copies files produced by ILSAmerge
.
# Merge files dir.create(file.path(tempdir(),"REDS2021"),showWarnings = FALSE) ILSAmerge(inputdir = system.file("extdata/reds", package = "ILSAmerge"), outputdir = file.path(tempdir(),"REDS2021")) # Show files with raw names list.files(file.path(tempdir(),"REDS2021")) # Rename files ILSArename(inputdir = file.path(tempdir(),"REDS2021")) # Show files new names list.files(file.path(tempdir(),"REDS2021"))
# Merge files dir.create(file.path(tempdir(),"REDS2021"),showWarnings = FALSE) ILSAmerge(inputdir = system.file("extdata/reds", package = "ILSAmerge"), outputdir = file.path(tempdir(),"REDS2021")) # Show files with raw names list.files(file.path(tempdir(),"REDS2021")) # Rename files ILSArename(inputdir = file.path(tempdir(),"REDS2021")) # Show files new names list.files(file.path(tempdir(),"REDS2021"))
Load 'SPSS' data from different International Large-Scale Assessments (ILSA), including: 'TIMSS', 'TIMSS Advanced', 'PIRLS', 'ICCS', 'ICILS', 'CIVED', 'REDS', 'RLII', and 'SITES' (2006) into a list.
justload( inputdir = getwd(), population, justattributes = FALSE, addcountries = FALSE )
justload( inputdir = getwd(), population, justattributes = FALSE, addcountries = FALSE )
inputdir |
a string indicating the path where ILSA 'SPSS' files are stored. |
population |
a character value indicating which files should be loaded.
For more information on available populations, run |
justattributes |
a logical value indicating if 0 rows should be loaded.
This can be used when we just need to check column attributes. Default is
|
addcountries |
a logical value indicating if country information should
be added to the elements of the list. This means adding the variable |
A list of tibbles.
# Path where raw 'SPSS' files are input <- system.file("extdata/reds", package = "ILSAmerge") # Load only attributes emptylist <- justload(inputdir = input, population = "BCGV1", justattributes = TRUE) # Load complete data fullist <- justload(inputdir = input, population = "BCGV1", justattributes = FALSE) # Load complete data and add country labels withcou <- justload(inputdir = input, population = "BCGV1", addcountries = TRUE)
# Path where raw 'SPSS' files are input <- system.file("extdata/reds", package = "ILSAmerge") # Load only attributes emptylist <- justload(inputdir = input, population = "BCGV1", justattributes = TRUE) # Load complete data fullist <- justload(inputdir = input, population = "BCGV1", justattributes = FALSE) # Load complete data and add country labels withcou <- justload(inputdir = input, population = "BCGV1", addcountries = TRUE)
Produces and saves an 'SPSS' merge syntax given a list of files.
spss.syntax(filelist, name, outputdir = getwd(), zsav = TRUE, SPSSlimit = 50)
spss.syntax(filelist, name, outputdir = getwd(), zsav = TRUE, SPSSlimit = 50)
filelist |
a character vector with the list of files to be merged. |
name |
a string with the name of the merged file (without any extension). |
outputdir |
the directory where the |
zsav |
a logical value indicating if the the merged file should
be compressed with zsav. Default is |
SPSSlimit |
a numerical value indicating the limit of files per command
of 'SPSS', typically |
Saves an .sps
file with the 'SPSS' syntax for merging the
desired files.
# Path where raw 'SPSS' files are input <- system.file("extdata/reds", package = "ILSAmerge") # Path where merged files will be saved dir.create(file.path(tempdir(),"spsssyntax")) output <- file.path(tempdir(),"spsssyntax") # List of BCGV1 files to be merged files <- list.files(path = input, pattern = "BCG.+V1|bcg.+v1") # Create 'SPSS' syntax spss.syntax(filelist = files, name = "BCGV1", outputdir = output, zsav = TRUE)
# Path where raw 'SPSS' files are input <- system.file("extdata/reds", package = "ILSAmerge") # Path where merged files will be saved dir.create(file.path(tempdir(),"spsssyntax")) output <- file.path(tempdir(),"spsssyntax") # List of BCGV1 files to be merged files <- list.files(path = input, pattern = "BCG.+V1|bcg.+v1") # Create 'SPSS' syntax spss.syntax(filelist = files, name = "BCGV1", outputdir = output, zsav = TRUE)