Description Usage Arguments Details References See Also Examples
Plot temperature data from screen observations (degrees celsius) through time.
1 2 3 4 5 6 7 8 9 |
x |
a cfScreenObs object. |
y |
missing. |
ggtheme |
character string (partially) matching the
|
scales |
character string partially matching the |
n_col |
the number of columns of plots (default 1). |
... |
further arguments passed to |
Temperature data from screen observations include the air, and wet bulb, temperature at the time the measurement was taken (dry bulb and wet bulb respectively), and the dew point. The dew point is the air temperature at which dew starts to form. That is the temperature to which a given air parcel must be cooled at constant pressure and constant water vapour content in order for saturation to occur.
The resulting figure plots the dry bulb, wet bulb and dew point temperatures on the same scale, for each station.
plot,cfDataList,missing-method
for general
information on default plotting of cfData
and cfDataList
objects, and the links within. See cf_query
for creating
cfScreenObs
objects.
Refer to theme
for more possible arguments to pass
to these methods.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
# Retrieve public temperature data from screen observations for the last week
# at Reefton Ews station
# Subtract 7 days from today's date to get the start date
last_week = paste(as.character(Sys.Date() - 7), 0)
reefton_screenobs = cf_query(cf_user(), cf_datatype(4, 1, 1), cf_station(),
start_date = last_week)
class(reefton_screenobs) # cfScreenObs object
# Plot the temperature data using the defaults
plot(reefton_screenobs)
# Enlarge the text and add the observations as points
library(ggplot2) # for element_text() and geom_point()
plot(reefton_screenobs, ggtheme = "bw", text = element_text(size = 16)) +
geom_point(size = 3, shape = 1)
# Save the plot as a png to the current working directory
library(ggplot2) # for ggsave()
ggsave("my_screenobs_plot.png")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.