forked from tidyverse/stringr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
162 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
\name{check_pattern} | ||
\alias{check_pattern} | ||
\title{Check that pattern is of the correct type for stringr functions...} | ||
\usage{check_pattern(pattern)} | ||
|
||
\description{ | ||
Check that pattern is of the correct type for stringr functions | ||
} | ||
\keyword{internal} | ||
\arguments{ | ||
\item{string}{input vector} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
\name{check_string} | ||
\alias{check_string} | ||
\title{Check that stringr is of the correct type for stringr functions...} | ||
\usage{check_string(string)} | ||
|
||
\description{ | ||
Check that stringr is of the correct type for stringr functions | ||
} | ||
\keyword{internal} | ||
\arguments{ | ||
\item{string}{input vector} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
\name{invert_match} | ||
\alias{invert_match} | ||
\title{Invert a matrix of locations...} | ||
\usage{invert_match(loc)} | ||
|
||
\description{ | ||
Invert a matrix of locations | ||
} | ||
|
||
\details{ | ||
Invert a matrix of match locations to match the opposite of what was | ||
previously matched. | ||
} | ||
\value{numeric match giving locations of non-matches} | ||
\arguments{ | ||
\item{loc}{matrix of match locations, as from \code{\link{str_locate_all}}} | ||
} | ||
\examples{numbers <- "1 and 2 and 4 and 456" | ||
num_loc <- str_locate_all(numbers, "[0-9]+")[[1]] | ||
str_sub(numbers, num_loc[, "start"], num_loc[, "end"]) | ||
|
||
text_loc <- invert_match(num_loc) | ||
str_sub(numbers, text_loc[, "start"], text_loc[, "end"])} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
\name{str_dup} | ||
\alias{str_dup} | ||
\title{Duplicate strings within a character vector.} | ||
\title{Duplicate and concatenate strings within a character vector.} | ||
\usage{str_dup(string, times)} | ||
|
||
\description{ | ||
Duplicate strings within a character vector. | ||
Duplicate and concatenate strings within a character vector. | ||
} | ||
|
||
\details{ | ||
Vectorised over \code{string} and \code{times}. | ||
} | ||
\value{character vector} | ||
\keyword{internal} | ||
\keyword{character} | ||
\arguments{ | ||
\item{string}{input character vector} | ||
\item{times}{number of times to duplicate each string} | ||
} | ||
\examples{fruit <- c("apple", "pear", "banana") | ||
str_dup(fruit, 2) | ||
str_dup(fruit, 1:3) | ||
str_c("ba", str_dup("na", 0:5))} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters