Hour rose plot. Copied and modified from the openair package. phour() plotted a 24-hour clock, indicating the active hours on the basis of a time column in a data frame. It is highly cumstomized on the basis of the openair::windrose() function`.

phour(my_df = NA, col_time = "created", ws = "ws", wd = "hour360", ws2 = NA, wd2 = NA,
    ws.int = 30, angle = 1, type = "default", cols = "default", grid.line = NULL,
    width = 1, seg = 0.9, auto.text = TRUE, breaks = 4, offset = 10, paddle = FALSE,
    key.header = NULL, key.footer = "(SBD)", key.position = "right", key = FALSE,
    dig.lab = 5, statistic = "prop.count", pollutant = NULL, cust_labels = c(0, 6,
        12, 18), annotate = FALSE, border = NA, quantile_line = TRUE, ...)

Arguments

my_df

A data frame containing the fields ws and wd.

col_time

the column name for the time stamp

ws

A character string of the name of the column representing the radium of the circular sectors in the diagram. It can be SBD payout, votes, comments, etc..

wd

A character sring of the name of the column representing the hour of the day.

ws2

The user can supply a second set of data with which the first can be compared.

wd2

see ws2.

ws.int

A numeric vector of the ws interval. Default is 2.

angle

The hour spokes. Other potentially useful angle is 3 (hours).

type

type determines how the data are split i.e. conditioned, and then plotted. It can be 'season', 'year', 'weekday'... The default is will produce a single plot using the entire data. It can also be a numeric or factor vector.

cols

Colours for plotting. 'default', 'increment', 'heat', 'jet', 'hue' and user defined, such as c("yellow", "green", "blue", "black").

grid.line

Grid line interval. NULL in default.It can also be a numeric value like 10, or a list like list(value = 10, lty = 5, col = "purple").

width

The adjustment factor for width of payout intervals. For example, width = 1.5 will make the paddle width 1.5 times wider. For paddle = TRUE.

seg

The width of the segments. 0.5 will produce segments 0.5 * angle.

auto.text

A logical value of whether formatting the names and units automatically in the titles and axis labels

breaks

A numeric vector of the number of break points for payouts. 4 by default, which generates the break points 2, 4, 6, 8 SBD for ws.int default of 2 SBD. It can also be c(0, 1, 10, 100), which breaks the data into segments <1, 1-10, 10-100, >100.

offset

A numeric value (default 10) of the size of the 'hole' in the middle of the plot, expressed as a percentage of the polar axis scale.

paddle

A logic value. TRUE means the 'paddle' style spokes, and FALSE means the 'wedge' style spokes.

key.header

A character string of additional text above the scale key.

key.footer

A character string of additional text below the scale key.

key.position

A character string of the location of the scale key. 'top', 'right', 'bottom' and 'left'.

key

Fine control of the scale key

dig.lab

A numeric value of the signficant digits at which scientific number formatting is used in break point.

statistic

A character string of the statistic to be applied.

  • 'prop.count' (default) sizes bins according to the proportion of the frequency of the records,

  • 'prop.mean' sizes bins according to their relative contribution to the mean,

  • 'abs.count' provides the absolute count of records in each bin.

pollutant

Alternative data series to be sampled.

cust_labels

A numeric vector displayed as the customed labels

annotate

A logic value or a character string.

  • TRUE: the percentage calm and mean values are printed in each panel together with a description of the statistic below the plot.

  • " ": only the stastic is below the plot.

  • Custom annotations may be added by setting value to c("annotation 1", "annotation 2").

border

A character string of the border colour for shaded areas.

quantile_line

whether to display the quantile line

...

other parameters

Value

A figure with the active hour rose

Examples

# NOT RUN {
phour()
# }