View source: R/expire_status.R
expire_status | R Documentation |
Note: this is a rigid function that needs variables 'id' and 't' (and
optionally 'expire') and will create a variable 'status' (if such exists it
will be overwritten). Feed this function a data frame with variables 'id'
(identifier) and 't' (integer valued time measurement) and - optionally -
'expire' (positive numeri). 't' represents times for some event whose status
(1) should expire (to 0) (strictly) after the integer duration specified by
'expire' (unless the status is "refreshed" by having another 't'-value
before expiration). Duplicated times (per individual) will always be
removed, and the output can also be reduced to the smallest output that
keeps track of the changing status by setting parameter 'slim' to
TRUE
.
expire_status(x, expire = NULL, slim = FALSE)
expire_state(x, expire = NULL, null.state = "", slim = FALSE)
x |
data frame with id variable 'id' and time variable 't' |
expire |
expiration boundary, if NULL needs to exists in 'x', if not NULL a variable called 'expire' will be created with the value(s) given here |
slim |
logical; remove unnecessary statuses? |
null.state |
value assigned to expired state |
a data frame
expire_state()
: generalization of expire_status; the 'status' - now
called 'state' (which must exist in 'x') - can be multivalued
expire_status_by_inventory
, expire_state_by_inventory
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.