Learn R Programming

manureshed (version 0.1.2)

run_state_analysis: Run State-Level Analysis

Description

Run manureshed analysis for a specific state

Usage

run_state_analysis(
  state,
  scale = "huc8",
  year = 2016,
  nutrients = c("nitrogen", "phosphorus"),
  include_wwtp = TRUE,
  output_dir = file.path(tempdir(), paste0("state_", tolower(state), "_results")),
  verbose = TRUE,
  ...
)

Value

List with analysis results for the state

Arguments

state

Character. Two-letter state abbreviation (e.g., "OH", "TX")

scale

Character. Spatial scale: "county", "huc8", or "huc2"

year

Numeric. Year to analyze

nutrients

Character vector. Nutrients to analyze

include_wwtp

Logical. Whether to include WWTP analysis

output_dir

Character. Output directory

verbose

Logical. Show progress messages

...

Additional arguments passed to run_builtin_analysis

Examples

Run this code
# \donttest{
# Use Texas which has more data
texas_results <- run_state_analysis(
  state = "TX",
  scale = "county",  # Use county for faster processing
  year = 2016,
  nutrients = "nitrogen",  # Single nutrient for speed
  include_wwtp = TRUE
)

# California county-level analysis
ca_results <- run_state_analysis(
  state = "CA",
  scale = "county",
  year = 2010,
  nutrients = "nitrogen"
)
# }

Run the code above in your browser using DataLab