Skip to content

vec_slice() cannot slice 0-column data.frames properly #179

@yutannihilation

Description

@yutannihilation
library(vctrs)
library(tibble)

vec_slice(tibble(.rows = 3), 1:3)
#> # A tibble: 0 x 0

vec_slice(tibble(x = tibble(.rows = 3)), 1:3)
#> Error: Positive column indexes in `[` must match number of columns:
#> * `.data` has 0 columns
#> * Position 1 equals 1
#> * Position 2 equals 2
#> * Position 3 equals 3
#> Backtrace:
#>     █
#>  1. └─vctrs::vec_slice(tibble(x = tibble(.rows = 3)), 1:3)
#>  2.   └─base::lapply(x, `[`, i)
#>  3.     ├─base:::FUN(X[[i]], ...)
#>  4.     └─tibble:::`[.tbl_df`(X[[i]], ...)
#>  5.       └─tibble:::check_names_df(i, x)
#>  6.         └─tibble:::check_names_df_numeric(j, x)

Created on 2019-01-31 by the reprex package (v0.2.1.9000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions