Skip to content

Dplyr+janitor+one column matrices in filter() #6679

@larry77

Description

@larry77

Hello,

I report this here (as instructed, see warning in the reprex below), but I think it is an issue of the excellent janitor package rather than dplyr.

In any case, it would be a pity if in the future this broke my workflow, so can anyone look into it?

Many thanks!

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(janitor)
#> 
#> Attaching package: 'janitor'
#> The following objects are masked from 'package:stats':
#> 
#>     chisq.test, fisher.test

df <- structure(list(member_state_3_letter_codes = c("AUT", "AUT", 
"AUT", "AUT", "AUT", "AUT", "AUT", "AUT", "AUT", "AUT", "AUT", 
"AUT", "AUT", "AUT", "AUT", "AUT", "AUT", "AUT", "AUT", "AUT"
), procedure_name = c("General Block Exemption Regulation", "Notified Aid", 
"Notified Aid", "Notified Aid", "Notified Aid", "Notified Aid", 
"Notified Aid", "Notified Aid", "General Block Exemption Regulation", 
"General Block Exemption Regulation", "General Block Exemption Regulation", 
"General Block Exemption Regulation", "General Block Exemption Regulation", 
"General Block Exemption Regulation", "General Block Exemption Regulation", 
"General Block Exemption Regulation", "General Block Exemption Regulation", 
"General Block Exemption Regulation", "General Block Exemption Regulation", 
"Notified Aid")), row.names = c(NA, -20L), class = c("tbl_df", 
"tbl", "data.frame"))


df2 <- df|>tabyl(procedure_name)
#> Warning: Using one column matrices in `filter()` was deprecated in dplyr 1.1.0.
#> ℹ Please use one dimensional logical vectors instead.
#> ℹ The deprecated feature was likely used in the dplyr package.
#>   Please report the issue at <https://github.com/tidyverse/dplyr/issues>.

df2
#>                      procedure_name  n percent
#>  General Block Exemption Regulation 12     0.6
#>                        Notified Aid  8     0.4

sessionInfo()
#> R version 4.2.2 (2022-10-31)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Debian GNU/Linux 11 (bullseye)
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.13.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
#>  [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
#>  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] janitor_2.1.0 dplyr_1.1.0  
#> 
#> loaded via a namespace (and not attached):
#>  [1] compiler_4.2.2    pillar_1.8.1      highr_0.9         R.methodsS3_1.8.2
#>  [5] R.utils_2.12.1    tools_4.2.2       digest_0.6.30     lubridate_1.9.0  
#>  [9] evaluate_0.17     lifecycle_1.0.3   tibble_3.1.8      R.cache_0.16.0   
#> [13] timechange_0.1.1  pkgconfig_2.0.3   rlang_1.0.6       reprex_2.0.2     
#> [17] cli_3.6.0         yaml_2.3.6        xfun_0.34         fastmap_1.1.0    
#> [21] withr_2.5.0       styler_1.8.0      stringr_1.5.0     knitr_1.40       
#> [25] generics_0.1.3    fs_1.5.2          vctrs_0.5.2       tidyselect_1.2.0 
#> [29] glue_1.6.2        snakecase_0.11.0  R6_2.5.1          fansi_1.0.4      
#> [33] rmarkdown_2.17    purrr_1.0.1       tidyr_1.3.0       magrittr_2.0.3   
#> [37] htmltools_0.5.3   utf8_1.2.2        stringi_1.7.8     R.oo_1.25.0

Created on 2023-02-02 with reprex v2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions