Author: Emma Tupone

# Analyzing NYC Climate Projections: Extreme Events and Sea Level Rise

#### Emma Tupone

## Introduction

This vignette demonstrates how to use the 38ps-fnsg() function to explore projected extreme climate events and sea level rise for New York City using the New York City Climate Projections: Extreme Events and Sea Level Rise dataset on the NYC Open Data portal.

The dataset provides projections under different climate scenarios, including:

- Number of heatwaves per year
- Cooling and heating degree days
- Projected sea level rise

Researchers, city planners, and policymakers can use this information to understand future climate risks, prepare for extreme weather events, and plan adaptation strategies.

## Retrieve a Sample of Data

    sample_data <- nyc_pull_dataset("38ps-fnsg", limit = 10)
    nyc_list_datasets()
    #> # A tibble: 2,389 × 26
    #>    key             uid   name  datasetinformation_a…¹ description type  category
    #>    <chr>           <chr> <chr> <chr>                  <chr>       <chr> <chr>
    #>  1 nyc_independen… 6ggx… NYC … NYC Independent Budge… "New York … data… City Go…
    #>  2 x2016_2017_gui… xr5s… 2016… Department of Educati… "New York … data… Educati…
    #>  3 competitive_se… d6di… Comp… Mayor's Office of Con… "Citywide … data… Business
    #>  4 x2015_2016_stu… hti8… 2015… Department of Educati… "Student D… data… Educati…
    #>  5 x2019_20_demog… ycfm… 2019… Department of Educati… "Student a… data… Educati…
    #>  6 x2012_2015_his… pffu… 2012… Department of Educati… "Daily lis… data… Educati…
    #>  7 x2014_2015_par… hdpu… 2014… Department of Educati… "2015 NYC … data… Educati…
    #>  8 x2019_20_schoo… jtpv… 2019… Department of Educati… "The Schoo… data… Educati…
    #>  9 x2017_2018_phy… qiyv… 2017… Department of Educati… "Local Law… data… Educati…
    #> 10 x2010_public_u… k2r4… 2010… Department of City Pl… "The 2010 … data… City Go…
    #> # ℹ 2,379 more rows
    #> # ℹ abbreviated name: ¹​datasetinformation_agency
    #> # ℹ 19 more variables: legislativecompliance_datasetfromtheopendataplan <chr>,
    #> #   url <chr>, update_datemadepublic <chr>, update_updatefrequency <chr>,
    #> #   last_data_updated_date <chr>,
    #> #   legislativecompliance_candatasetfeasiblybeautomated <chr>,
    #> #   update_automation <chr>, legislativecompliance_hasdatadictionary <chr>, …

    sample_data
    #> # A tibble: 10 × 16
    #>    period           sea_lelel_rise number_of_days_year_…¹ number_of_days_year_…²
    #>    <chr>            <chr>                           <dbl>                  <dbl>
    #>  1 Baseline (1981-… n/a                                69                     17
    #>  2 2030s (10th Per… 6 in                               85                     27
    #>  3 2030s (25th Per… 7 in                               85                     27
    #>  4 2030s (75th Per… 11 in                              99                     46
    #>  5 2030s (90th Per… 13 in                             104                     54
    #>  6 2050s (10th Per… 12 in                              91                     32
    #>  7 2050s (25th Per… 14 in                              99                     38
    #>  8 2050s (75th Per… 19 in                             100                     62
    #>  9 2050s (90th Per… 23 in                             121                     69
    #> 10 2080s (10th Per… 21 in                             104                     46
    #> # ℹ abbreviated names: ¹​number_of_days_year_with, ²​number_of_days_year_with_1
    #> # ℹ 12 more variables: number_of_days_year_with_2 <dbl>,
    #> #   number_of_days_year_with_3 <dbl>, number_of_heatwaves_year <dbl>,
    #> #   average_lenth_of_heat_waves <dbl>, number_of_days_year_with_4 <dbl>,
    #> #   number_of_days_year_with_5 <dbl>, cooling_degree_days <dbl>,
    #> #   number_of_days_year_with_6 <dbl>, heating_degree_days <dbl>,
    #> #   number_of_days_year_with_7 <dbl>, number_of_days_year_with_8 <dbl>, …

This code retrieves 10 rows of data from the NYC Open Data endpoint for extreme events and sea level rise projections.

## Summarize Key Metrics

    summary_table <- sample_data |>
      select(period, number_of_heatwaves_year, cooling_degree_days, heating_degree_days) |> dplyr::slice_head(n = 10)

    summary_table
    #> # A tibble: 10 × 4
    #>    period         number_of_heatwaves_…¹ cooling_degree_days heating_degree_days
    #>    <chr>                           <dbl>               <dbl>               <dbl>
    #>  1 Baseline (198…                      2                1156                4659
    #>  2 2030s (10th P…                      3                1397                3589
    #>  3 2030s (25th P…                      3                1471                3766
    #>  4 2030s (75th P…                      6                1757                4049
    #>  5 2030s (90th P…                      7                1903                4240
    #>  6 2050s (10th P…                      4                1568                3102
    #>  7 2050s (25th P…                      5                1713                3384
    #>  8 2050s (75th P…                      8                2124                3754
    #>  9 2050s (90th P…                      9                2335                3996
    #> 10 2080s (10th P…                      6                1817                2298
    #> # ℹ abbreviated name: ¹​number_of_heatwaves_year

- Period=climate period (e.g., “Baseline”, “2030s”)
- number_of_heatwaves_year=projected heatwaves per year
- cooling_degree_days/heating_degree_days=metrics of temperature extremes

This table gives a quick overview of projected extreme events for different scenarios.

## Visualization

    plot_data <- sample_data |>
      mutate(number_of_heatwaves_year = as.numeric(number_of_heatwaves_year))

    ggplot(plot_data, aes(x = period, y = number_of_heatwaves_year)) +
      geom_col() +
      labs(
        title = "Projected Number of Heatwaves by Climate Period",
        x = "Climate Period",
        y = "Projected Heatwaves per Year"
      ) +
      theme_minimal() +
      theme(axis.text.x = element_text(angle = 45, hjust = 1))

This plot shows how the number of heatwaves is projected to change across scenarios. It helps visualize future climate risks at a glance.