convert_days_to_week-methods: Converts a matrix of daily counts into weekly counts, using...

convert_days_to_weekR Documentation

Converts a matrix of daily counts into weekly counts, using the ISOweek standard, provided that a deparate data frame is appointed from which to extract the actual dates corresponding to each row of the matrix.

Description

This is an internal function of the package vetsyn, made available as an exported funciton in order to allow users to take advantage of the function retro_summary() from the package. That function generates a markdown file with R code that can be useful for users during restrospective analysis of syndromic data. When those R codes are run manually by the user, this function may be needed.

Usage

convert_days_to_week(counts.df, dates.df, date.format = "%Y-%m-%d")

Arguments

counts.df

a matrix with rows corresponding to daily counts, and columns corresponding to syndromic groups

dates.df

a data frame where the first column contain dates

date.format

the date format in the dates variable, by default Y-m-d.

Examples

data(lab.daily)
my.syndromic <- raw_to_syndromicD (id=lab.daily$SubmissionID,
                                  syndromes.var=lab.daily$Syndrome,
                                  dates.var=lab.daily$DateofSubmission,
                                  date.format="%d/%m/%Y")
weekly <- convert_days_to_week(my.syndromic@observed; my.syndromic@dates)

nandadorea/vetsyn documentation built on April 30, 2022, 1:15 a.m.