Description Usage Arguments Details Value See Also Examples
Splits each element of str
into substring.
pattern
indicates delimiters that separate the input
into fields. The input data between the matches become the
fields themselves.
1 2 | stri_split_fixed(str, pattern, n_max = -1L, omit_empty = FALSE,
opts_collator = list())
|
str |
character vector with strings to search in |
pattern |
character vector with fixed patterns |
n_max |
integer vector, maximal number of pieces to return |
omit_empty |
logical vector; determines whether empty strings should be removed from the result |
opts_collator |
a named list as generated with
|
Vectorized over str
, pattern
, n_max
,
and omit_empty
.
If n_max
is negative (default), then all pieces are
extracted.
omit_empty
is applied during splitting: if set to
TRUE
, then empty strings will never appear in the
resulting vector.
Pass opts_collator
that is equal to NA
for a
much faster, but locale unaware, (exact) bitwise string
comparisons. For natural language text, however, this may
not be what you really want.
Returns a list of character vectors.
Other locale_sensitive: stri_cmp
,
stri_compare
; stri_count_fixed
;
stri_detect_fixed
;
stri_enc_detect2
;
stri_locate_all_fixed
,
stri_locate_all_fixed,
,
stri_locate_first_fixed
,
stri_locate_first_fixed,
,
stri_locate_last_fixed
,
stri_locate_last_fixed
;
stri_opts_collator
; stri_order
,
stri_sort
;
stri_replace_all_fixed
,
stri_replace_all_fixed
,
stri_replace_first_fixed
,
stri_replace_first_fixed
,
stri_replace_last_fixed
,
stri_replace_last_fixed
;
stri_trans_tolower
,
stri_trans_totitle
,
stri_trans_toupper
;
stringi-locale
;
stringi-search-fixed
Other search_fixed: stri_count_fixed
;
stri_detect_fixed
;
stri_extract_all_fixed
,
stri_extract_all_fixed,
,
stri_extract_first_fixed
,
stri_extract_first_fixed,
,
stri_extract_last_fixed
,
stri_extract_last_fixed
;
stri_locate_all_fixed
,
stri_locate_all_fixed,
,
stri_locate_first_fixed
,
stri_locate_first_fixed,
,
stri_locate_last_fixed
,
stri_locate_last_fixed
;
stri_opts_collator
;
stri_replace_all_fixed
,
stri_replace_all_fixed
,
stri_replace_first_fixed
,
stri_replace_first_fixed
,
stri_replace_last_fixed
,
stri_replace_last_fixed
;
stringi-search-fixed
;
stringi-search
Other search_split: stri_split_charclass
,
stri_split_charclass
;
stri_split_lines
,
stri_split_lines
,
stri_split_lines1
,
stri_split_lines1
;
stri_split_regex
,
stri_split_regex
; stri_split
;
stringi-search
1 2 3 4 | ## Not run:
stri_split_fixed("Lorem ipsum dolor sit amet", " ")
## End(Not run)
|
[[1]]
[1] "Lorem" "ipsum" "dolor" "sit" "amet"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.