sortlevels: Sort and Format Levels for Factoring

Description Usage Arguments Value Author(s)

Description

This function will reformat and order visit names for use in factors; it also allows modifying case and excluding some levels.

Usage

1
sortlevels(all.visits, pre.levels, excluded.levels, title.case=TRUE)

Arguments

all.visits

A vector of all visit names to sort and format.

pre.levels

A vector of visit levels that should precede the rest (e.g. screening or pre-study visits) in ordering.

excluded.levels

A vector of visit names that should be excluded from the factor levels.

title.case

Logical. Should the names of the factor levels use title case?

Value

A vector of visit levels, sorted and formatted, potentially with exclusions.

Author(s)

Ben Rich, benjamin.rich@certara.com with edits by Ryan Kyle, ryan.kyle@mail.mcgill.ca


rpkyle/cscmisc documentation built on May 13, 2019, 12:06 p.m.