The R Project SVN R

Rev

Rev 32685 | Rev 37810 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32685 Rev 36073
Line 8... Line 8...
8
\usage{
8
\usage{
9
strsplit(x, split, extended = TRUE, fixed = FALSE, perl = FALSE)
9
strsplit(x, split, extended = TRUE, fixed = FALSE, perl = FALSE)
10
}
10
}
11
\arguments{
11
\arguments{
12
  \item{x}{
12
  \item{x}{
13
    character vector, each element of which is to be split.
13
    character vector, each element of which is to be split.  Other
-
 
14
    inputs, including a factor, will give an error.
14
  }
15
  }
15
  \item{split}{
16
  \item{split}{
16
    character vector containing \link{regular expression}(s)
17
    character vector (or object which can be coerced to such)
-
 
18
    containing \link{regular expression}(s) (unless \code{fixed = TRUE})
17
    (unless \code{fixed = TRUE}) to use as \dQuote{split}.  If empty
19
    to use as \dQuote{split}.  If empty matches occur, in particular if
18
    matches occur, in particular if \code{split} has length 0, \code{x} is
20
    \code{split} has length 0, \code{x} is split into single characters.
19
    split into single characters.  If \code{split} has length greater than
21
    If \code{split} has length greater than 1, it is re-cycled along
20
    1, it is re-cycled along \code{x}.
22
    \code{x}.
21
  }
23
  }
22
  \item{extended}{
24
  \item{extended}{
23
    logical. if \code{TRUE}, extended regular expression matching
25
    logical.  If \code{TRUE}, extended regular expression matching
24
    is used, and if \code{FALSE} basic regular expressions are used.
26
    is used, and if \code{FALSE} basic regular expressions are used.
25
  }
27
  }
26
  \item{fixed}{
28
  \item{fixed}{
27
    logical. If \code{TRUE} match string exactly, otherwise
29
    logical.  If \code{TRUE} match string exactly, otherwise
28
    use regular expressions.
30
    use regular expressions.
29
  }
31
  }
30
  \item{perl}{
32
  \item{perl}{
31
    logical. Should perl-compatible regexps be used?
33
    logical.  Should perl-compatible regexps be used?
32
    Has priority over \code{extended}.
34
    Has priority over \code{extended}.
33
  }
35
  }
34
}
36
}
35
\value{
37
\value{
36
  A list of length \code{length(x)} the \code{i}-th element of which
38
  A list of length \code{length(x)} the \code{i}-th element of which
37
  contains the vector of splits of \code{x[i]}.
39
  contains the vector of splits of \code{x[i]}.
38
}
40
}
39
\details{
41
\details{
40
  Arguments \code{x} and \code{split} will be coerced to character, so
42
  Argument \code{split} will be coerced to character, so
41
  you will see uses with \code{split = NULL} to mean
43
  you will see uses with \code{split = NULL} to mean
42
  \code{split = character(0)}, including in the examples below.
44
  \code{split = character(0)}, including in the examples below.
43
 
45
 
44
  Note that spltting into single characters can be done via
46
  Note that spltting into single characters can be done via
45
  \code{split=character(0)} or \code{split=""}; the two are equivalent
47
  \code{split=character(0)} or \code{split=""}; the two are equivalent