Skip to content

Commit 718ff98

Browse files
committed
Use full arg name for rep(length.out=...)
This bug causes warnings if options(warnPartialMatchArgs=TRUE).
1 parent a0f03f5 commit 718ff98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/word.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
#' word(str, 2, sep = fixed('..'))
2929
word <- function(string, start = 1L, end = start, sep = fixed(" ")) {
3030
n <- max(length(string), length(start), length(end))
31-
string <- rep(string, length = n)
32-
start <- rep(start, length = n)
33-
end <- rep(end, length = n)
31+
string <- rep(string, length.out = n)
32+
start <- rep(start, length.out = n)
33+
end <- rep(end, length.out = n)
3434

3535
breaks <- str_locate_all(string, sep)
3636
words <- lapply(breaks, invert_match)

0 commit comments

Comments
 (0)