ncdc_plot: Plot NOAA climate data.

Description Usage Arguments Details Value See Also Examples

View source: R/ncdc_plot.r

Description

Plot NOAA climate data.

Usage

1
ncdc_plot(..., breaks = NULL, dateformat = "%d/%m/%y")

Arguments

...

Input noaa object or objects.

breaks

Regularly spaced date breaks for x-axis. See examples for usage. See date_breaks. Default: NULL (uses ggplot2 default break sformatting)

dateformat

Date format using standard POSIX specification for labels on x-axis. See date_format

Details

This function accepts directly output from the ncdc function, not other functions.

This is a simple wrapper function around some ggplot2 code. There is indeed a lot you can modify in your plots, so this function just does some basic stuff. Look at the internals for what the function does.

Value

ggplot2 plot

See Also

Other ncdc: ncdc_combine, ncdc_datacats, ncdc_datasets, ncdc_datatypes, ncdc_locs_cats, ncdc_locs, ncdc_stations, ncdc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# Search for data first, then plot
out <- ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', datatypeid='PRCP',
   startdate = '2010-05-01', enddate = '2010-10-31', limit=500)
ncdc_plot(out)
ncdc_plot(out, breaks="14 days")
ncdc_plot(out, breaks="1 month", dateformat="%d/%m")
ncdc_plot(out, breaks="1 month", dateformat="%d/%m")

# Combine many calls to ncdc function
out1 <- ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', datatypeid='PRCP',
   startdate = '2010-03-01', enddate = '2010-05-31', limit=500)
out2 <- ncdc(datasetid='GHCND', stationid='GHCND:USW00014895', datatypeid='PRCP',
   startdate = '2010-09-01', enddate = '2010-10-31', limit=500)
df <- ncdc_combine(out1, out2)
ncdc_plot(df)
## or pass in each element separately
ncdc_plot(out1, out2, breaks="45 days")

## End(Not run)

leighseverson/rnoaa documentation built on May 21, 2019, 3:06 a.m.