Git Product home page Git Product logo

rseilution's Introduction

rseilution

R tools for deriving air toxicity for geographic coordinates


This code will append annual air toxicity data to any point location within the United States. The toxicity data come from the US Environmental Protection Agency's (EPA) Risk-Screening Environmental Indicators (RSEI) model, which is based on data collected for the Toxic Release Inventory (TRI).

The code offers many options. The following example is for points with a unique ID (in column geo_id) in a single state (Delaware de) for a single year (2015) stored with latitude/longitude coordinates (in columns lat and lon) in a CSV file (my_points.csv). It will return the results to a CSV file (results.csv).

source('RSEIAssignedToPoints.R')
results <- appendRSEI('my_points.csv', state='de', year=2015,
                      unique_id='geo_id', x_name='lon', y_name='lat',
                      out_file='results.csv')

If the points are associated with multiple states and/or multiple years, you will need to pass the column names containing that information for each point to the state and year parameters respectively. States need to be coded using their two character code (upper or lower case) and years as integers or strings.

source('RSEIAssignedToPoints.R')
results <- appendRSEI('my_points.csv', state='state_code', year='visit_year',
                      unique_id='geo_id', x_name='lon', y_name='lat',
                      out_file='results.csv')

We designed this to be accessible for both regular R users and non-R users alike. If you don't use R, you just need to install R and run the script as shown above by passing in your CSV (or SHP file). It will return a CSV (or SHP) that can be opened in other software. For R users, the script can take data frames, spatial points data frames and simple features objects, and it returns spatial points data frames that can be manipulated and plotted.

RSEI toxicity data is provided by EPA as a 0.5 mile raster covering the entire US. The code associates each point with the raster cell it falls in, and returns the associated toxicity data aggregated over the selected year. The code also returns the annualized data allowing for toxicity maps to be produced.

Log of total toxicity for 2002 Rhode Island, with three points of interest added. total toxicity

Log of lead toxicity for 2002 Rhode Island, with three points of interest added. lead toxicity

The Jupyter Notebook and RMarkdown files in the repository contain more examples on the functionality and data output.


We encourage collaborators who would like to extend the functionality.

This work was supported by the Environmental Influences on Child Health Outcomes (ECHO) program of the National Institutes of Health (NIH) under award number 4UH3OD023332-03.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.