convert_unit | R Documentation |
Processes the parameter unit to format it correctly as a comma-separated string, regardless of whether it is provided as a numeric, character, or list/vector.
convert_unit(unit, t)
unit |
Number of the 'GreenFeed' unit(s). Can be a numeric, character, list, or vector. |
t |
Type of function (opts: 1 and 2). |
A character string of the unit(s) in the correct comma-separated format.
# Example 1: Providing unit as a character vector
unit <- c("592", "593")
convert_unit(unit, 1)
# Example 2: Providing unit as a single numeric
unit <- 592
convert_unit(unit, 1)
# Example 3: Providing unit as a comma-separated character string
unit <- "592, 593"
convert_unit(unit, 1)
# Example 4: Providing unit as a list
unit <- list(592, 593)
convert_unit(unit, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.