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

safeframe warns when unlabelled columns are dropped #55

Open
Bisaloo opened this issue Dec 3, 2024 · 0 comments · May be fixed by #63
Open

safeframe warns when unlabelled columns are dropped #55

Bisaloo opened this issue Dec 3, 2024 · 0 comments · May be fixed by #63
Labels
bug Something isn't working

Comments

@Bisaloo
Copy link
Member

Bisaloo commented Dec 3, 2024

We shouldn't see a warning when dist, an unlabelled column, is dropped in the following reprex:

library(safeframe)
#> 
#> Attaching package: 'safeframe'
#> The following object is masked from 'package:base':
#> 
#>     labels

x <- make_safeframe(cars,
  speed = "Miles per hour"
)

x[, "speed"]
#> Warning: The following labelled variables are lost:
#>  dist - NULL
#> 
#> // safeframe object
#>    speed
#> 1      4
#> 2      4
#> 3      7
#> 4      7
#> 5      8
#> 6      9
#> 7     10
#> 8     10
#> 9     10
#> 10    11
#> 11    11
#> 12    12
#> 13    12
#> 14    12
#> 15    12
#> 16    13
#> 17    13
#> 18    13
#> 19    13
#> 20    14
#> 21    14
#> 22    14
#> 23    14
#> 24    15
#> 25    15
#> 26    15
#> 27    16
#> 28    16
#> 29    17
#> 30    17
#> 31    17
#> 32    18
#> 33    18
#> 34    18
#> 35    18
#> 36    19
#> 37    19
#> 38    19
#> 39    20
#> 40    20
#> 41    20
#> 42    20
#> 43    20
#> 44    22
#> 45    23
#> 46    24
#> 47    24
#> 48    24
#> 49    24
#> 50    25
#> 
#> labelled variables:
#>  speed - Miles per hour

Created on 2024-12-03 with reprex v2.1.1

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.0 (2024-04-24)
#>  os       Ubuntu 24.04.1 LTS
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language en_US
#>  collate  en_GB.UTF-8
#>  ctype    en_GB.UTF-8
#>  tz       Europe/Paris
#>  date     2024-12-03
#>  pandoc   3.2 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/x86_64/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  backports     1.5.0   2024-05-23 [1] CRAN (R 4.4.0)
#>  checkmate     2.3.2   2024-07-29 [1] CRAN (R 4.4.1)
#>  cli           3.6.3   2024-06-21 [1] CRAN (R 4.4.0)
#>  digest        0.6.37  2024-08-19 [1] CRAN (R 4.4.1)
#>  evaluate      1.0.1   2024-10-10 [1] CRAN (R 4.4.1)
#>  fastmap       1.2.0   2024-05-15 [1] CRAN (R 4.4.0)
#>  fs            1.6.5   2024-10-30 [1] CRAN (R 4.4.0)
#>  glue          1.8.0   2024-09-30 [1] CRAN (R 4.4.1)
#>  htmltools     0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0)
#>  knitr         1.49    2024-11-08 [1] CRAN (R 4.4.0)
#>  lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.4.0)
#>  reprex        2.1.1   2024-07-06 [1] CRAN (R 4.4.0)
#>  rlang         1.1.4   2024-06-04 [1] CRAN (R 4.4.0)
#>  rmarkdown     2.29    2024-11-04 [1] CRAN (R 4.4.0)
#>  rstudioapi    0.17.1  2024-10-22 [1] CRAN (R 4.4.0)
#>  safeframe   * 0.0.1   2024-11-30 [1] Github (epiverse-trace/safeframe@7bf3f00)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.4.0)
#>  withr         3.0.2   2024-10-28 [1] CRAN (R 4.4.0)
#>  xfun          0.49    2024-10-31 [1] CRAN (R 4.4.0)
#>  yaml          2.3.10  2024-07-26 [1] CRAN (R 4.4.1)
#> 
#>  [1] /home/hugo/.local/share/R/x86_64-pc-linux-gnu-library/4.4
#>  [2] /opt/R/4.4.0/lib/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────

My assumption is that a show_null is TRUE when it should be FALSE but I don't have bandwidth to dig at this time.

@Bisaloo Bisaloo added the bug Something isn't working label Dec 3, 2024
@Bisaloo Bisaloo added this to the Before first CRAN release milestone Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant