makelabel: makelabel generates a label from text and values

makelabelR Documentation

makelabel generates a label from text and values

Description

makelabel It is common to want a label with text and a series of values. But paste and paste0 cycles the text and the values. To avoid this makelabel first combines the values as text and then adds the input text to the front of the values

Usage

makelabel(txt, vect, sep = "_", digits = 3)

Arguments

txt

the input text for the label, can be empty

vect

the series of values to be included in the label

sep

the separator for the components; defaults to '_'

digits

how many significant digits for the values; default = 3

Value

a character string made up of text and values

Examples

pars <- c(18.3319532,33.7935124,3.0378107,6.0194465,0.5815360,0.4270468)
makelabel("Cohort1",pars[c(1,3,5)],sep="__")
makelabel("",pars[c(1,3,5)],sep="__",digits=4)

haddonm/codeutils documentation built on April 15, 2024, 1:02 p.m.