laOpenData provides simple, reproducible access to Los Angeles-related
datasets from the
Los Angeles Open Data Portal platform —
directly from R, with no API keys or manual downloads required.
Working directly with Socrata APIs can be cumbersome — laOpenData
simplifies this process into a clean, reproducible workflow.
Version 0.1.1 introduces a streamlined, catalog-driven interface for Los Angeles Open Data, extending the open data ecosystem beyond New York to support cross-city analysis and comparative civic research.
The package provides three core functions:
la_list_datasets() — Browse available datasets from the live Los
Angeles Open Data catalogla_pull_dataset() — Pull any cataloged dataset by key, with
filtering, ordering, and optional date controlsla_any_dataset() — Pull any Los Angeles Open Data dataset directly
via its Socrata JSON endpointDatasets pulled via la_pull_dataset() automatically apply sensible
defaults from the catalog (such as default ordering and date fields),
while still allowing user control over:
This redesign reduces maintenance burden, improves extensibility, and provides a more scalable interface for working with Los Angeles Open Data.
All functions return clean tibble outputs and support filtering viafilters = list(field = "value").
# devtools::install_github("nyc-open-data-lab/laOpenData")
install.packages("laOpenData", repos = c('https://nyc-open-data-lab.r-universe.dev', 'https://cloud.r-project.org'))
library(laOpenData)
la_vacent_buildings <- la_pull_dataset(
dataset = "building_safety",
limit = 1000
)
head(la_vacent_buildings)
#> # A tibble: 6 × 10
#> case area_planning_commiss…¹ case_type year_case_created date_case_created
#> <dbl> <chr> <chr> <dbl> <dttm>
#> 1 800237 Harbor GENERAL 2018 2018-01-02 00:00:00
#> 2 800342 West Los Angeles GENERAL 2018 2018-01-02 00:00:00
#> 3 800312 Central GENERAL 2018 2018-01-02 00:00:00
#> 4 800344 Central FRP 2018 2018-01-02 00:00:00
#> 5 800341 Central GENERAL 2018 2018-01-02 00:00:00
#> 6 800343 Central FRP 2018 2018-01-02 00:00:00
#> # ℹ abbreviated name: ¹area_planning_commission
#> # ℹ 5 more variables: date_case_closed <dttm>, csr <dbl>,
#> # csr_problem_description <chr>, latitude <dbl>, longitude <dbl>
laOpenData makes Los Angeles’s civic datasets accessible to students,
educators, analysts, and researchers through a unified and user-friendly
R interface.
Developed to support reproducible research, open-data literacy, and real-world analysis.
While the RSocrata
package provides a general interface for any Socrata-backed portal,
laOpenData is specifically tailored for Los Angeles Open Data
Portal.
This package is part of a broader ecosystem of tools for working with open data:
nycOpenData — streamlined access to NYC Open Data\nysOpenData — streamlined access to NY State Open DatamtaOpenData — streamlined access to MTA-related NY State Open DatachiOpenData — streamlined access to Chicago-related City Open DataTogether, these packages provide a consistent, user-friendly interface for working with civic data across jurisdictions.
2ucp-7wg5); use catalog-based keys instead.We welcome contributions! If you find a bug or would like to request a wrapper for a specific Los Angeles dataset, please open an issue or submit a pull request on GitHub.
Christian A. Martinez 📧 c.martinez0@outlook.com
GitHub: @martinezc1