add_squids_to_df {squids}R Documentation

Add a column with SQUIDs to a data frame

Description

Add a column with SQUIDs to a data frame

Usage

add_squids_to_df(
  x,
  colName = "SQUID",
  warnAgainstOverwriting = TRUE,
  origin = Sys.time(),
  follow = NULL,
  followBy = NULL
)

Arguments

x

The data frame

colName

The name of the column to add; set to NULL to return the column instead of the data frame.

warnAgainstOverwriting

Whether to throw an error if a column with name colName already exists.

origin

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).

follow

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.

followBy

When following a vector of SQUIDs, this can be used to specify the distance between the two vectors in centiseconds.

Value

If colName = NULL, the column with SQUIDs; otherwise, x with an additional column named with the value of colName.

Examples

squids::add_squids_to_df(
  mtcars
);

[Package squids version 25.6.1 Index]