compare_two_years: compare_two_years

Description Usage Arguments Examples

Description

Returns scatter plot for 2 years for data elements of interest. Option to narrow down data geographically

Usage

1
2
3
4
compare_two_years(w.use, data.elements, year.x.y, area.column,
  areas = NA, legend = FALSE, pctDiff = 0, valDiff = 0,
  log.oper = "and", c.palette = c("#999999", "#E69F00", "#56B4E9",
  "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7"))

Arguments

w.use

dataframe, the water use data

data.elements

chr, vector of data elements to be plotted (1 plot per element)

year.x.y

int, 2-element vector specifying the two years to be plotted

area.column

character that defines which column to use to specify area

areas

chr, codes indicating HUCs, counties, states, aquifers, etc.

legend

is a logical function to include list of counties in a legend if manageable, default is FALSE

pctDiff

is the percent difference outlier criterion , default is zero

valDiff

is the value difference outlier criterion, default is zero

log.oper

indictaes the logical operator between the two outlier criteria, default is "and"

c.palette

color palette to use for points

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
w.use <- wUseSample
data.elements <- c("PS.TOPop", "PS.SWPop")
areas <- "10" # NA uses all areas
area.column <- "STATECODE"
year.x.y <- c(2005,2010)
compare_two_years(w.use, data.elements, year.x.y, area.column, areas)
compare_two_years(w.use, data.elements, year.x.y, area.column)
compare_two_years(w.use, "PS.TOPop", year.x.y, area.column)
pctDiff <- 10
valDiff <- 0
compare_two_years(w.use, "PS.SWPop", year.x.y, area.column, pctDiff, valDiff)

USGS-R/wateRuse documentation built on May 9, 2019, 9:35 p.m.