read_tdf: Read TRIM data files

Description Usage Arguments Value The TRIM data file format See Also

View source: R/read_tdf.R

Description

Read data files intended for the original TRIM programme.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
read_tdf(x, ...)

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

## S3 method for class '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()


rtrim documentation built on April 21, 2020, 5:06 p.m.