check_observations: Check whether there are sufficient observations to run a...

Description Usage Arguments Value See Also

View source: R/data_checks.R

Description

Check whether there are sufficient observations to run a model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
check_observations(x, ...)

## S3 method for class 'data.frame'
check_observations(
  x,
  model,
  count_col = "count",
  year_col = "year",
  month_col = NULL,
  covars = character(0),
  changepoints = numeric(0),
  eps = 1e-08,
  ...
)

## S3 method for class 'trimcommand'
check_observations(x, ...)

## S3 method for class 'character'
check_observations(x, ...)

Arguments

x

A trimcommand object, a data.frame, or the location of a TRIM command file.

...

Parameters passed to other methods.

model

[numeric] Model 1, 2 or 3?

count_col

[character|numeric] column index of the counts in x

year_col

[character|numeric] column index of years or time points in x

month_col

[character|numeric] optional column index of months in x

covars

[character|numeric] column index of covariates in x

changepoints

[numeric] Changepoints (model 2 only)

eps

[numeric] Numbers whose absolute magnitude are lesser than eps are considered zero.

Value

A list with two components. The component sufficient takes the value TRUE or FALSE depending on whether sufficient counts have been found. The component errors is a list, of which the structure depends on the chosen model, that indicates under what conditions insufficient data is present to estimate the model.

See Also

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


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