This R-package contains a Shiny application to explore the WLS data. You will need to obtain a copy of the data for yourself. For more, see https://wls.wisc.edu.
For more details about the data, see the WLS data portal.
You can install wlsDataBrowser using the remotes packages as
follows:
remotes::install_github("rmtrane/wlsDataBrowser")You can run the Shiny application interactively using the following:
wlsDataBrowser::wlsDataBrowserApp()You can optionally set the file path so you don’t manually have to choose the file when running the application. Add the following to your .Rprofile file with the path to your local copy of the data:
options(wlsDataBrowser.data_path = "/path/to/wls/data.dta")You will need to restart your R session for the changes to take effect.
The app shows a table of all the variables in the data. The table includes three columns:
- the variable name as it appears in the data file
- the round the variable relates to. This is infered from the variable label
- the variable label extracted from the label
Once installed, you should be able to find two add-ins in RStudio:
WLS Data Script Sketchruns the functionload_data_script()which creates a new file prefilled with a sketch for loading the WLS data. If the optionwlsDataBrowser.data_pathis set, this is used for the file argument inhaven::read_dtacall. If not, the file argument would have to be filled in manually.WLS Data Browserruns the Shiny application, which allows one to browse the data.
If using Positron, the following snippet
can be added to keybindings.json to easily launch the data browser
(here, keyboard combo cmd+alt+shift+w launches the data browser):
{
"key": "cmd+alt+shift+w",
"command": "workbench.action.executeCode.console",
"description": "Browse WLS Data",
"args": {
"langId": "r",
"code": "wlsDataBrowser:::wlsDataBrowser()"
}
}Search for Open Keyboard Shortcuts (JSON) using the command palette
(cmd/ctrl+shift+p) to open the keybindings.json file.