Shouldn't [[i, ]] be an error?
library(tibble)
iris[[ , 1]]
#> Error in `[[.data.frame`(iris, , 1): argument "..1" is missing, with no default
iris[[1, ]]
#> Error in `[[.data.frame`(iris, 1, ): argument "..2" is missing, with no default
as_data_frame(iris)[[ ,1]]
#> Error in `[[.tbl_df`(as_data_frame(iris), , 1): argument "i" is missing, with no default
Why does this "work"?
as_data_frame(iris)[[1, ]]
#> [1] 5.1
The plot thickens
library(tibble)
mtcars[["Lotus Europa", "mpg"]]
#> [1] 30.4
Why the message about a column?
as_data_frame(mtcars)[["Lotus Europa", "mpg"]]
#> Error: Unknown column 'Lotus Europa'
Shouldn't
[[i, ]]be an error?Why does this "work"?
The plot thickens
Why the message about a column?