File: cut_bound.Rd

package info (click to toggle)
r-cran-popepi 0.4.13%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,656 kB
  • sloc: sh: 13; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 872 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utility_functions.R
\name{cut_bound}
\alias{cut_bound}
\title{Change output values from cut(..., labels = NULL) output}
\usage{
cut_bound(t, factor = TRUE)
}
\arguments{
\item{t}{is a character vector of elements, e.g. "(20,60]"}

\item{factor}{logical; TRUE returns informative character string, FALSE numeric (left value)}
}
\value{
If \code{factor = TRUE}, returns a character vector; else returns a numeric
vector.
}
\description{
Selects lowest values of each factor after cut() based
on the assumption that the value starts from index 2 and end in comma ",".
}
\details{
type = 'factor': "[50,52)" -> "50-51" OR "[50,51)" -> "50"

type = 'numeric': lowest bound in numeric.
}
\examples{
cut_bound("[1900, 1910)") ## "1900-1909"
}
\author{
Matti Rantanen
}