Learn R Programming

accrued (version 1.4)

data.accrued: Data structure for partially accruing data

Description

Creates an object of the accrued class for use in the plot, summary, and error functions in the accrued package.

Usage

data.accrued(data, start = NULL, final = NULL)

Arguments

data
A matrix of time series data, with rows as consecutive encounter dates and columns as accrual lag.
start
The start date. If none is specified it defaults to 1.
final
Vector of final counts for each encounter date. If omitted, the final column of data is used for the final counts.

Value

data.accrued returns an object of the accrued class.An object of the accrued class is a list containing the following components:
final
Vector of final counts
data
Matrix of counts. The value at the $i$th row and $j$th column represent the count for encounter date $i$ as known $j-1$ days after the encounter date.
start
List of boolean start variable and start date
Print, summary and plot methods exist for objects of the accrued class.

Details

The function converts a matrix of patrically accrued counts into an accrued object. The value at the $i$th row and $j$th column of data represent the count for encounter date $i$ as known $j-1$ days after the encounter date. If final is not specified, the last column of data is used as the final count.

Summary and plot methods exist for objects of this class. Several additional graph types are available, including barcode, uploadPattern, laggedTSarray and lagHistogram.

See Also

print.accrued, plot.accrued, summary.accrued, plot.summary.accrued

Examples

Run this code
	
	# simulated accrued data
	data(accruedDataExample)				

	# Convert to data.accrued object
	dat <- data.accrued(accruedDataExample)	

	dat$start
	# This is 1 because no start date was specified.

	dat					# uses print.accrued
	summary(dat)		# uses summary.accrued

	plot(summary(dat)) 	# produces a plot of the summary object
	plot(dat)			# plots time series of differences between lags


	# Convert to data.accrued object, start date now specified.
	dat <- data.accrued(accruedDataExample, start="2012-09-15")	

Run the code above in your browser using DataLab