netmeta (version 1.2-1)

treats: Abbreviate treatment names

Description

Auxiliary function to create uniquely abbreviated treatment names.

Usage

treats(x, nchar.trts = 8, row = TRUE)

Arguments

x

A vector with treatment names or a matrix with treatment names as row and / or column names.

nchar.trts

A numeric defining the minimum number of characters used to create unique treatment names.

row

A logical indicating whether row or column names should be used (only considered if argument x is a matrix).

Details

This auxiliary function can be used to create uniquely abbreviated treatment names (and is used internally in several R functions for this purpose).

Initially, to construct uniquely abbreviated treatment names, substring is used to extract the first nchar.trts characters. If these abbreviated treatment names are not unique, abbreviate with argument minlength = nchar.trts is used.

See Also

netmeta, print.netmeta, print.summary.netmeta

Examples

Run this code
# NOT RUN {
data(Senn2013)
#
net1 <- netmeta(TE, seTE, treat1, treat2,
                studlab, data = Senn2013)

# Use matrix with fixed effects estimates to create unique
# treatment names (with four characters)
#
treats(net1$TE.fixed, nchar.trts = 4)

# With two characters
#
treats(net1$TE.fixed, nchar.trts = 2)

# With one character
#
treats(net1$TE.fixed, nchar.trts = 1)

# }

Run the code above in your browser using DataLab