MyNixOS website logo
Description

Processing, Visualizing, and Labeling Americas Barometer Data.

Labeling, weighting, and plotting data following custom style guidelines for use in reports, presentations, and social media posts. The Center for Global Democracy (formerly the Latin American Public Opinion Project) at Vanderbilt University is a leader in public survey research, best known for the Americas Barometer project. The publicly available data can be downloaded from: <https://www.vanderbilt.edu/lapop/data-access.php>.

lapop R package

These are helper functions to wrangle labels and produce visualizations of 'AmericasBarometer' data following LAPOP Lab's editorial guidelines.

🔗 Package website:https://lapop-central.github.io/lapop/


🛠️ Installation

To install the package in your console, run:

devtools::install_github("lapop-central/lapop", 
                         force = TRUE, 
                         build_vignettes = TRUE)

⚙️ Workflow: 'AmericasBarometer' Variable & Value Labels

For the full online guide, see:

📖 LAPOP Data Guide for R Users

1. Data Structure

'AmericasBarometer' datasets are distributed in Stata .dta format with multilingual metadata (question wording and response options) embedded as attributes. These support cross-national and longitudinal comparability.

2. Preferred Loading Method

Use:

readstata13::read.dta13()

to preserve the full metadata structure.

Other methods such as haven::read_dta() or rio::import() may fail to import the STATA attributes.

3. Variable Labels (Question Wording)

  • Stored in the expansion.fields attribute.
  • Use lpr_extract_notes() to convert into a tidy data frame.
  • Assign preferred language labels with lpr_set_attr() using the appropriate noteid.

4. Value Labels (Response Options)

  • Stored in the label.table attribute.
  • Use lpr_set_ros() to assign these response labels in English, Spanish, or Portuguese.

🎨 Workflow: 'AmericasBarometer' Data Visualization

📖 LAPOP Visualization Guide

  1. Load the package in R:

    library(lapop)
    
  2. LAPOP Lab fonts is automatically loaded, yet you can also manually if needed:

    lapop_fonts()
    
  3. Apply the 'AmericasBarometer' design effects with:

    lpr_data()
    
  4. Choose the appropriate lpr graph type:

    • Histograms: lpr_hist()
    • Cross-country comparison: lpr_cc()
    • Time series: lpr_ts()
    • Breakdown by covariates: lpr_mover()

5. Store the output in an R object.

  • File names: .csv and graphics files should have the same name. Their names should be in the following standard format: CountryYear/ts_DVcode(s)_IVcode(s)_graphtype.extension.

  • Examples:

    • mex21_countfair1_hist.csv
    • hnd_b4_ts.svg
    • ab23_vic1ext_pais_cc.svg
  • There will be some cases that do not easily fit this standard. Use your best judgment.

  1. Use the corresponding lapop plotting function to produce the visualization:

    • Examples: lapop_hist(), lapop_cc(), lapop_ts(), etc.

7. Export the figure to your machine with:

lapop_save()

🤝 Workflow: Contributing to the lapop R Package

  1. Fork the repository and clone it to your local machine.
  2. Create a new branch for your feature or fix.
  3. Add your new function in the R/ folder.
  4. Document the function with roxygen2 comments.
  5. Run devtools::document() to generate .Rd files in man/ and update NAMESPACE.
  6. Commit your changes and push the branch to your fork.
  7. Submit a pull request to the main repository.
  8. If you find a bug, please consider contributing to the lapop package — we spent all our money on coffee and data cleaning.

Metadata

Version

2.1.5

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows