Learn R Programming

rtrim (version 2.1.1)

read_tdf: Read TRIM data files

Description

Read data files intended for the original TRIM programme.

Usage

read_tdf(x, ...)

# S3 method for character read_tdf( x, missing = -1, weight = FALSE, ncovars = 0, labels = character(0), ... )

# S3 method for trimcommand read_tdf(x, ...)

Arguments

x

a filename or a trimcommand object

...

(unused)

missing

[integer] missing value indicator. Missing values are translated to NA.

weight

[logical] indicate presence of a weight column

ncovars

[logical] The number of covariates in the file

labels

[character] (optional) specify labels for the covariates. Defaults to cov<i> (i=1,2,...,ncovars) if none are specified.

Value

A data.frame.

The TRIM data file format

TRIM input data is stored in a ASCII encoded file where headerless columns are separated by one or more spaces. Below are the columns as read_tdf expects them.

Variable status R type
site requiered integer
time required integer
count required numeric
weight optional numeric
<covariate1> optional integer
...
<covariateN> optional integer

See Also

Other modelspec: check_observations(), read_tcf(), set_trim_verbose(), trimcommand(), trim()