Prints a list of items from a vector or list, with an optional title. Items are indented and prefixed with a dash.
See also
Other print functions:
ospPrintClass()
,
ospPrintHeader()
Examples
# Print a simple vector with title
vector <- c("A", "B", "C")
ospPrintItems(vector, title = "Letters")
#> Letters:
#> • A
#> • B
#> • C
# Print a named vector with title
named_vector <- c(A = 1, B = 2, C = 3)
ospPrintItems(named_vector, title = "Letters")
#> Letters:
#> • A: 1
#> • B: 2
#> • C: 3
# Print a list including empty values
list_with_nulls <- list("Min" = NULL, "Max" = 100, "Unit" = NA)
ospPrintItems(list_with_nulls, title = "Parameters", print_empty = TRUE)
#> Parameters:
#> • Min: NULL
#> • Max: 100
#> • Unit: NA