Skip to contents

A svyplan_overlap from design_overlap() is a numeric vector of overlap fractions indexed by lag, so x[1] and x[12] are plain numbers ready for an overlap argument. $ reaches the counts and the schedule behind them.

Usage

# S3 method for class 'svyplan_overlap'
print(x, ...)

# S3 method for class 'svyplan_overlap'
format(x, ...)

# S3 method for class 'svyplan_overlap'
as.double(x, ...)

# S3 method for class 'svyplan_overlap'
as.list(x, ...)

# S3 method for class 'svyplan_overlap'
x[i]

# S3 method for class 'svyplan_overlap'
Ops(e1, e2)

# S3 method for class 'svyplan_overlap'
Math(x, ...)

# S3 method for class 'svyplan_overlap'
x[[i]]

# S3 method for class 'svyplan_overlap'
x$name

# S3 method for class 'svyplan_overlap'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  stringsAsFactors = FALSE,
  validRN = TRUE,
  ...
)

# S3 method for class 'svyplan_overlap'
x[i] <- value

# S3 method for class 'svyplan_overlap'
x[[i]] <- value

Arguments

x

A svyplan_overlap object.

...

Additional arguments are not supported and produce an error.

i

Lag to extract, by position or by its name, so x[12] and x[["12"]] are both the twelve-occasion overlap. The result is a bare number, carrying neither the class nor the lag as a name.

e1, e2

Operands. Arithmetic and comparison return bare numerics, the counts and the schedule describing the profile as computed and not whatever it was transformed into.

name

Field to extract: overlap, shared, n_occasion, schedule, lag or life.

row.names, optional, stringsAsFactors, validRN

Standard as.data.frame() arguments.

value

Replacement value. Replacement is refused, an overlap being computed from a schedule rather than assembled.

Value

print() returns x invisibly; format() a string; as.double() the overlap vector; as.data.frame() one row per lag; Ops() and Math() bare numerics. Replacement is an error.

Details

The values, the shared counts and the schedule describe one design, so nothing may move the values while leaving the rest: subsetting and arithmetic return bare numerics, and replacement is an error. That also settles pmax() and pmin(), which copy the attributes of their first argument without dispatching to any method and would otherwise return something still labelled an overlap whose counts no longer follow from its values. They assign through [<-, so they are refused here too. Convert with as.double(x) and they work as usual.