CreateObservationMatrices: CreateObservationMatrices

View source: R/Init.r

CreateObservationMatricesR Documentation

CreateObservationMatrices

Description

Compute 2D Sparse matrices enconding observations recorded in case.df. Rows are locations (indexed by postcodes) and columns are time steps. If a character vector of length N is passed as argument types, then N matrices are created only for the events with matching case.df$types. The matrices are saved on disk as '*observation_matrix.RData' files.

Usage

CreateObservationMatrices(
  case.df,
  types = NULL,
  date.time.field = "week",
  postcode.field = "postcode",
  more.postcodes = c(),
  more.weeks = c()
)

Arguments

case.df

A data.frame of events.

types

NULL or a character vector.

date.time.field

A character string.

postcode.field

A character string.

more.postcodes

A character vector

more.weeks

A integer vector

Value

None

Examples

CreateObservationMatrices(case.df)
CreateObservationMatrices(case.df, types=c("1.0", "33.0"), date.time.field = "SAMPLE_DT_numeric", postcode.field = "Patient Postcode")

mcavallaro/rancovr documentation built on April 17, 2025, 7:21 p.m.