Add a column with SQUIDs to a data frame
add_squids_to_df(
x,
colName = "SQUID",
warnAgainstOverwriting = TRUE,
origin = Sys.time(),
follow = NULL,
followBy = NULL
)If colName = NULL, the column with SQUIDs; otherwise, x with
an additional column named with the value of colName.
The data frame
The name of the column to add; set to NULL to return the
column instead of the data frame.
Whether to throw an error if a column with
name colName already exists.
The origin to use when generating the SQUIDs. This allows
you to reproduce the same sequence of SQUIDs. You can easily get an
origin with get_current_origin(). The origin is a timestamp;
an object of class POSIXct (see squids-package for more
details).
A vector of one or more SQUIDs (or a list; lists are
recursively unlist()ed); the highest SQUID will be taken, converted
to a timestamp, and used as origin (well, 0.01 second later), so that the
new SQUIDs will follow that sequence.
When following a vector of SQUIDs, this can be used to specify the distance between the two vectors in centiseconds.
squids::add_squids_to_df(
mtcars
);
Run the code above in your browser using DataLab