read_tdf function

Read TRIM data files

Read TRIM data files

Read data files intended for the original TRIM programme.

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.

Returns

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.

VariablestatusR type
siterequieredinteger
timerequiredinteger
countrequirednumeric
weightoptionalnumeric
<covariate1>optionalinteger
...
<covariateN>optionalinteger

See Also

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

  • Maintainer: Patrick Bogaart
  • License: EUPL
  • Last published: 2024-06-21