aggregateCRT {CRTspat}R Documentation

Aggregate data across records with duplicated locations

Description

aggregateCRT aggregates data from a "CRTsp" object or trial data frame containing multiple records with the same location, and outputs a list of class "CRTsp" containing single values for each location, for both the coordinates and the auxiliary variables.

Usage

aggregateCRT(trial, auxiliaries = NULL)

Arguments

trial

An object of class "CRTsp" containing locations (x,y) and variables to be summed

auxiliaries

vector of names of auxiliary variables to be summed across each location

Details

Variables that in the trial dataframe that are not included in auxiliaries are retained in the output algorithm "CRTsp" object, with the value corresponding to that of the first record for the location in the input data frame

Value

A list of class "CRTsp"

Examples

{
trial <- readdata('example_site.csv')
trial$base_denom <- 1
aggregated <- aggregateCRT(trial, auxiliaries = c("RDT_test_result","base_denom"))
}

[Package CRTspat version 1.3.0 Index]