Learn R Programming

HRW (version 1.0-6)

ozoneSub: Ozone levels in midwest U.S.A.

Description

This dataset is a subset of the ozone2 dataset in the fields package. It contains the 8-hour average ozone concentration at 147 sites in the midwest region of the U.S.

Usage

data(ozoneSub)

Arguments

Format

A data frame with 147 observations on the following 3 variables:

longitude

observation longitude.

latitude

observation latitude.

ozone

ozone level.

References

Nychka, D., Furrer, R., Paige, J. and Sain, S. (2017). fields: Tools for spatial data. R package version 9.0. https://www.r-project.org.

Examples

Run this code
library(HRW) ; data(ozoneSub)
if (require("mgcv"))
{
   fit.ozone.mgcv.tp <- gam(ozone ~ s(longitude,latitude,bs = "tp"),
                            data = ozoneSub,method = "REML")
   plot(fit.ozone.mgcv.tp,scheme = 2,
        main = "ozone concentration",bty = "l")
   points(ozoneSub$longitude,ozoneSub$latitude)
}
if (require("fields"))
   US(add = TRUE,lwd = 2)

Run the code above in your browser using DataLab