read_us_tsca: Read-In and Clean the US EPA TSCA Data Set

View source: R/read_us_tsca.R

read_us_tscaR Documentation

Read-In and Clean the US EPA TSCA Data Set

Description

This function reads-in and automatically cleans the US EPA TSCA data set.

Usage

read_us_tsca(path)

Arguments

path

(Character) The path to the extracted CSV file.

Details

The function reads-in and cleans the US EPA TSCA data set into flat format.

Value

Returns a data frame.

Note

Tested with version 2022-02.

Author(s)

Raoul Wolf (https://github.com/RaoulWolf/)

Examples

## Not run: 
download.file(
  url = paste0(
    "https://www.epa.gov/system/files/other-files/2022-03/",
    "csv-non-cbi-tsca-inventory-022022.zip"
    ),
  destfile = "csv-non-cbi-tsca-inventory-022022.zip"
)

unzip(zipfile = "csv-non-cbi-tsca-inventory-022022.zip")

file_name <- list.files()

path <- file_name[grepl(pattern = "TSCA", file_name)]

tsca <- read_us_tsca(path)

## End(Not run)

RaoulWolf/cleanventory documentation built on Sept. 15, 2022, 4:25 a.m.