filter_by_month: Filter FORCIS data by month of sampling

View source: R/filter_by_month.R

filter_by_monthR Documentation

Filter FORCIS data by month of sampling

Description

Filters FORCIS data by month of sampling.

Usage

filter_by_month(data, months)

Arguments

data

a data.frame. One obtained by ⁠read_*_data()⁠ functions.

months

a numeric containing one or several months.

Value

A data.frame containing a subset of data for the desired months.

Examples

# Attach the package ----
library("forcis")

# Import example dataset ----
file_name <- system.file(file.path("extdata", "FORCIS_net_sample.csv"), 
                         package = "forcis")

net_data <- read.table(file_name, dec = ".", sep = ";")

# Add 'data_type' column ----
net_data$"data_type" <- "Net"

# Dimensions of the data.frame ----
dim(net_data)

# Filter by months ----
net_data_sub <- filter_by_month(net_data, months = 1:2)

# Dimensions of the data.frame ----
dim(net_data_sub)

FRBCesab/forcis documentation built on Oct. 25, 2024, 9:26 a.m.