Learn R Programming

agridat (version 1.8.1)

nebraska.farmincome: Nebraska farm income in 2007 by county

Description

Nebraska farm income in 2007 by county

Arguments

source

U.S. Department of Agriculture-National Agriculture Statistics Service. http://censtats.census.gov/usa/usa.shtml

Details

The variables for each county are: Value of farm products sold - crops (NAICS) 2007 (adjusted) Value of farm products sold - livestock, 2007 (adjusted). Area in square miles. Note: Cuming county is a very important beef-producing county. Some counties are not reported to protect privacy. Western Nebraska is dryer and has lower income. South-central Nebraska is irrigated and has higher crop income per square mile.

Examples

Run this code
dat <- nebraska.farmincome

require("maps")
require("mapproj")
require("latticeExtra")

# Raw, county-wide incomes.  Note the outlier Cuming county
mapplot(county ~ crop + animal,
        data = dat, colramp=RedGrayBlue,
        main="Agricultural income per county",
        map = map('county', 'nebraska', plot = FALSE, fill = TRUE,
                  projection = "mercator"))

# Now scale to income/mile^2
dat <- within(dat, {
  crop.rate <- crop/area
  animal.rate <- animal/area
})
# And use manual breakpoints.
mapplot(county ~ crop.rate + animal.rate,
        data = dat,
        main="Agricultural income per square mile (percentile breaks)",
        map = map('county', 'nebraska', plot = FALSE, fill = TRUE,
                  projection = "mercator"),
        colramp=RedGrayBlue,
        breaks=quantile(c(dat$crop.rate, dat$animal.rate),
                        c(0,.1,.2,.4,.6,.8,.9,1), na.rm=TRUE)
        )

Run the code above in your browser using DataLab