Description Usage Arguments Details Value See Also Examples
hasRegularAgeTime
tests whether an object has a "regular" age-time
plan, where regular means that all age steps and/or time steps have the same
length. If an object does have a regular age-time plan, then
ageTimeStep
returns then length of the age and/or time steps.
1 2 3 4 5 6 7 | hasRegularAgeTime(object)
## S4 method for signature 'DemographicArray'
hasRegularAgeTime(object)
## S4 method for signature 'MetaData'
hasRegularAgeTime(object)
|
object |
Object of class |
Functions such as ageTimeStep
and rotateAgeTime
can only be applied to objects that have regular age-time plans.
Step lengths equals the widths of the intervals if a dimension has
dimscale
"Intervals"
, and the distance between points
if the dimension has dimscale
"Points"
. Any 'open'
intervals (ie intervals beginning with -Inf
or ending with
Inf
) are ignored.
An 'age step' is a step along a dimension with dimtype
"age"
, and a 'time step' is a step along a dimension with dimtype
"time"
.
If object
has both an age dimension and a time dimension, then the
age steps and time steps must all be equal for the age-time plan to be
regular.
If object
does not have either an age dimension or a time dimension,
then it is regular. However, ageTimeStep
throws an error.
TRUE
or an error.
DemographicArray
, dimtypes
,
dimscales
, FUNCTIONS REQUIRE REGULAR.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(demdata)
x <- Counts(VAPopn)
x
hasRegularAgeTime(x)
ageTimeStep(x)
x <- Counts(occupationalStatus)
x
hasRegularAgeTime(x)
## Not run: ageTimeStep(x) ## no age or time dimensions
a <- array(rnorm(3),
dim = 3,
dimnames = list(year = c(2000, 2005, 2020)))
x <- Values(a)
## Not run: hasRegularAgeTime
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.