File: vec2mat2.Rd

package info (click to toggle)
r-cran-multcompview 0.1-10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 268 kB
  • sloc: makefile: 2
file content (54 lines) | stat: -rw-r--r-- 1,303 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
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/vec2mat2.R
\name{vec2mat2}
\alias{vec2mat2}
\title{Convert a vector of hyphenated names into a character matrix.}
\usage{
vec2mat2(x, sep = "-")
}
\arguments{
\item{x}{Vector of hyphenated names}

\item{sep}{"strsplit" character to apply to names(x).}
}
\value{
A character matrix with rownames = x and with the character string
preceding the "sep" character in the first column and the character string
following the "sep" character in the second column.
}
\description{
Convert a vector of hyphenated names into a character matrix with 2 columns
containing the names split in each row.
}
\details{
If each element of x does not contain exactly 1 "sep" character, an error is
issued.
}
\examples{

vec2mat2(c("a-b", "a-c", "b-c"))

vec2mat2(c("a-b", "b-a"))

\dontshow{
(tst3 <- substring(try(
 vec2mat2(c("a", "b-a", "b-c"))), 1, 20)
=="Error in vec2mat2(c(")
# Error:  name without a sep character 

(tst4 <- substring(try(
 vec2mat2(c("a-c", "b-a", "b-c-d"))), 1, 20)
=="Error in vec2mat2(c(")
# Error:  multiple hyphens (sep characters)

} 

}
\seealso{
\code{\link{vec2mat}} \code{\link{multcompLetters}}
}
\author{
Spencer Graves
}
\keyword{array}
\keyword{manip}