Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

Author(s)

Guido Schwarzer sc@imbi.uni-freiburg.de

See Also

Examples

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)

netmeta

Network Meta-Analysis using Frequentist Methods

v1.4-0
GPL (>= 2)
Authors
Gerta Rücker [aut] (<https://orcid.org/0000-0002-2192-2560>), Ulrike Krahn [aut], Jochem König [aut] (<https://orcid.org/0000-0003-4683-0360>), Orestis Efthimiou [aut] (<https://orcid.org/0000-0002-0955-7572>), Guido Schwarzer [aut, cre] (<https://orcid.org/0000-0001-6214-9087>)
Initial release
2021-05-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.