File: utf8_graphemes.Rd

package info (click to toggle)
r-cran-cli 3.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,288 kB
  • sloc: ansic: 16,412; cpp: 37; sh: 13; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 805 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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utf8.R
\name{utf8_graphemes}
\alias{utf8_graphemes}
\title{Break an UTF-8 character vector into grapheme clusters}
\usage{
utf8_graphemes(x)
}
\arguments{
\item{x}{Character vector.}
}
\value{
List of characters vectors, the grapheme clusters of the input
string.
}
\description{
Break an UTF-8 character vector into grapheme clusters
}
\examples{
# Five grapheme clusters
str <- paste0(
  "\U0001f477\U0001f3ff\u200d\u2640\ufe0f",
  "\U0001f477\U0001f3ff",
  "\U0001f477\u200d\u2640\ufe0f",
  "\U0001f477\U0001f3fb",
  "\U0001f477\U0001f3ff")
cat(str, "\n")
chrs <- utf8_graphemes(str)
}
\seealso{
Other UTF-8 string manipulation: 
\code{\link{utf8_nchar}()},
\code{\link{utf8_substr}()}
}
\concept{UTF-8 string manipulation}