Skip to content

Commit 5a44ed1

Browse files
committed
subsetting back tibble when i > nrow
1 parent 6e7f62d commit 5a44ed1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/subset.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
}
4343

4444
cn <- names(res)
45-
not_tsibble <- !(index_var(x) %in% cn) || vec_size(res) > vec_size(x)
45+
nr <- vec_size(x)
46+
not_tsibble <- !(index_var(x) %in% cn) || vec_size(res) > nr || any(i > nr)
4647
if (not_tsibble) return(as_tibble(res))
4748

4849
if (!is_null(i)) {

0 commit comments

Comments
 (0)