File: diff_str.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 (40 lines) | stat: -rw-r--r-- 1,180 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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/diff.R
\name{diff_str}
\alias{diff_str}
\title{Compare two character strings, character by character}
\usage{
diff_str(old, new, max_dist = Inf)
}
\arguments{
\item{old}{First string, must not be \code{NA}.}

\item{new}{Second string, must not be \code{NA}.}

\item{max_dist}{Maximum distance to consider, or \code{Inf} for no limit.
If the LCS edit distance is larger than this, then the function
throws an error with class \code{"cli_diff_max_dist"}. (If you specify
\code{Inf} the real limit is \code{.Machine$integer.max} but to reach this the
function would have to run a very long time.)}
}
\value{
A list that is a \code{cli_diff_str} object and also a
\code{cli_diff_chr} object, see \link{diff_str} for the details about its
structure.
}
\description{
Characters are defined by UTF-8 graphemes.
}
\examples{
str1 <- "abcdefghijklmnopqrstuvwxyz"
str2 <- "PREabcdefgMIDDLEnopqrstuvwxyzPOST"
diff_str(str1, str2)
}
\seealso{
The diffobj package for a much more comprehensive set of
\code{diff}-like tools.

Other diff functions in cli: 
\code{\link{diff_chr}()}
}
\concept{diff functions in cli}