File: parenthesize.Rd

package info (click to toggle)
r-cran-assertive.base 0.0-9-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 476 kB
  • sloc: sh: 13; makefile: 2
file content (54 lines) | stat: -rw-r--r-- 1,531 bytes parent folder | download | duplicates (2)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{parenthesize}
\alias{parenthesize}
\alias{parenthesise}
\title{Wrap a string in brackets}
\usage{
parenthesize(
  x,
  type = c("round_brackets", "square_brackets", "curly_brackets", "angle_brackets",
    "chevrons", "hyphens", "en_dashes", "em_dashes", "commas")
)

parenthesise(
  x,
  type = c("round_brackets", "square_brackets", "curly_brackets", "angle_brackets",
    "chevrons", "hyphens", "en_dashes", "em_dashes", "commas")
)
}
\arguments{
\item{x}{Character vector to wrap in parenthenses.}

\item{type}{String naming the type of parenthesis.}
}
\value{
A character vector of the input wrapped in parentheses.
}
\description{
Parenthesise a character vector by wrapping elements in brackets, 
dashes or commas.
}
\note{
English grammar terminology is awfully confusing.  The verb 'to 
parenthesise' means to wrap a phrase in brackets or dashes or commas,
thus denoting it as supplementary material that could be left out.
A 'parenthesis' as a noun is often used as a synonym for a round bracket.
}
\examples{
paste("There were three", parenthesise(3), "mice in the experiment.")
paste(
  "I love parmos", 
  parenthesise("Teesside's finest culinary invention", "en_dashes"), 
  "but they are sure to give me heart disease."
)
parenthesise(letters[1:5], "curly")
paste0(
  "The R language", 
  parenthesise("an offshoot of S and Scheme", "commas"), 
  "is quite good for data analysis."
)
}
\seealso{
\code{\link[base]{sQuote}}
}