cal_mean: Calculate the mean of the nearest N stations

View source: R/cal_mean.R

cal_meanR Documentation

Calculate the mean of the nearest N stations

Description

Calculate the mean of the nearest N stations

Usage

cal_mean(id, dt, N = 5, BYcols = c("Year", "Month", "Day"), ...)

Arguments

id

The ID of the desired station

dt

A data.table of observation data. Typically, it should contain the columns including ID, Year, Month and Day.

N

A integer indicating how many stations to be used.

BYcols

A character vector of column names: e.g., DT[, sum(a), by=c("x", "y")].

...

Other arguments passed to data.table.

Value

A data.table with missing value filled for the disired station.


hxfan1227/cmdcr documentation built on Nov. 1, 2024, 12:40 a.m.