Skip to contents

These functions filter a dataset using features of the "date" column, as defined by mqo_dict(). Current options include the year, the month of the year, the day of the week, and the hour of the day. These options allow users to flexibly filter their data; for example, returning only weekday evenings in Summer months. All but filter_year() require short-term data; filter_year() will work out whether the data is short- or long-term based on the data type of the "date" column.

Usage

filter_year(data, years, dict = mqor::mqo_dict())

filter_month(data, months = 1:12, dict = mqor::mqo_dict())

filter_wday(data, wdays = 1:7, dict = mqor::mqo_dict())

filter_hour(data, hours = 0:23, dict = mqor::mqo_dict())

Arguments

data

An R data.frame containing at least five columns; a numeric column of observed values, a numeric column of modelled values, a character or factor column of identifiers that identify the site associated with the concentrations, a character or factor column of identifiers that identify the pollutant being measured/modelled, and a character or factor column containing just "fixed" or "indicative" to label each site. See demo_shortterm for an example format.

years, months, wdays, hours

A numeric vector indicating the years (any intger), months of the year (1 to 12), days of the week (1 to 7, where 1 is Sunday), or hours of the day (1 to 24) to retain in the data.

dict

See mqo_dict() for more information. Acts as a data dictionary to specify the columns in the data {mqor} should use.

See also