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

filtering zero rows from an empty data frames gives nonsense #782

Closed
momeara opened this issue Nov 18, 2014 · 2 comments
Closed

filtering zero rows from an empty data frames gives nonsense #782

momeara opened this issue Nov 18, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@momeara
Copy link

@momeara momeara commented Nov 18, 2014

> library(dplyr)

 Attaching package: ‘dplyr’

 The following object is masked from ‘package:stats’:

     filter

 The following objects are masked from ‘package:base’:

     intersect, setdiff, setequal, union

 > sessionInfo()
 R version 3.1.1 (2014-07-10)
 Platform: x86_64-unknown-linux-gnu (64-bit)

 locale:
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
 [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

 attached base packages:
 [1] stats     graphics  grDevices utils     datasets  methods   base

 other attached packages:
 [1] dplyr_0.3.0.9000

 loaded via a namespace (and not attached):
 [1] assertthat_0.1 compiler_3.1.1 DBI_0.3.1      magrittr_1.0.1 parallel_3.1.1
 [6] Rcpp_0.11.3    tools_3.1.1
 > x <- data_frame() %>% filter(F)
 > x
 data frame with 0 columns and 0 rows
 > x <- data_frame() %>% filter(F)
!> x
 data frame with 0 columns and 65 rows
@hadley
Copy link
Member

@hadley hadley commented Nov 20, 2014

MRE:

library(dplyr)
replicate(10, data.frame() %>% filter(F) %>% nrow())

Loading

@hadley hadley added the bug label Nov 20, 2014
@hadley hadley added this to the 0.3.1 milestone Nov 20, 2014
@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Nov 27, 2014

I was getting

> replicate(10, data_frame() %>% filter(F) )
Error: not compatible with STRSXP

Loading

romainfrancois added a commit that referenced this issue Nov 27, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants