Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add stri_sub_replace() #339

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion R/sub.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ stri_sub <- function(str, from = 1L, to = -1L, length) {
#' @rdname stri_sub
#' @export
#' @usage stri_sub(str, from = 1L, to = -1L, length, omit_na=FALSE) <- value
"stri_sub<-" <- function(str, from = 1L, to = -1L, length, omit_na=FALSE, value) {
stri_sub_replace <- function(str, from = 1L, to = -1L, length, omit_na=FALSE, value) {
if (missing(length)) {
if (is.matrix(from) && !missing(to))
warning("argument `to` is ignored in the current context")
Expand All @@ -136,3 +136,7 @@ stri_sub <- function(str, from = 1L, to = -1L, length) {
.Call(C_stri_sub_replacement, str, from, NULL, length, omit_na, value)
}
}

#' @rdname stri_sub
#' @export
"stri_sub<-" <- stri_sub_replace