`create_range()` converts a factor column "bin" into a character vector, extracts numeric range values from the character vector, and combines them with additional columns "bin_size" and "binned_time" to return a numeric vector representing the range information.

create_range(
  x,
  bin_size_colname = "scmp_bin_size",
  bin_col = "scmp_bin",
  verbose = TRUE
)

Arguments

x

A data frame that should contain the following columns:

bin

A factor column representing the bin intervals in the format "[x, y]".

bin_size

A numeric column representing the bin size.

binned_time

A numeric column representing the binned time.

bin_size_colname

The name of the column containing the bin size.

bin_col

The name of the column containing the bin intervals.

verbose

Logical; if TRUE, prints detailed output.

Value

A numeric vector containing four elements:

lower_bound

The lower bound of the bin interval.

upper_bound

The upper bound of the bin interval.

bin_size

The bin size.

binned_time

The binned time.

Author

Priyansh Srivastava spriyansh29@gmail.com