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

Add quiet argument to drop_unspec_vars() #58

Open
bms63 opened this issue Mar 5, 2024 · 0 comments
Open

Add quiet argument to drop_unspec_vars() #58

bms63 opened this issue Mar 5, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@bms63
Copy link

bms63 commented Mar 5, 2024

I would like to suppress the messages for dropped variables from this function.

library(metacore)
library(haven)
library(dplyr)
load(metacore_example("pilot_ADaM.rda"))
spec <- metacore %>% select_dataset("ADSL")
data <- read_xpt(metatools_example("adsl.xpt")) %>%
select(USUBJID, SITEID) %>%
mutate(foo = "Hello")
drop_unspec_vars(data, spec)
The following variable(s) were dropped:
foo
A tibble: 254 × 2
USUBJID SITEID

1 01-701-1015 701
2 01-701-1023 701
3 01-701-1028 701
4 01-701-1033 701
5 01-701-1034 701
6 01-701-1047 701
7 01-701-1097 701
8 01-701-1111 701
9 01-701-1115 701
10 01-701-1118 701
… with 244 more rows
ℹ Use print(n = ...) to see more rows

message suppressed

library(metacore)
library(haven)
library(dplyr)
load(metacore_example("pilot_ADaM.rda"))
spec <- metacore %>% select_dataset("ADSL")
data <- read_xpt(metatools_example("adsl.xpt")) %>%
select(USUBJID, SITEID) %>%
mutate(foo = "Hello")
suppressMessages(
drop_unspec_vars(data, spec))
A tibble: 254 × 2
USUBJID SITEID

1 01-701-1015 701
2 01-701-1023 701
3 01-701-1028 701
4 01-701-1033 701
5 01-701-1034 701
6 01-701-1047 701
7 01-701-1097 701
8 01-701-1111 701
9 01-701-1115 701
10 01-701-1118 701
… with 244 more rows
ℹ Use print(n = ...) to see more rows

MAybe done by a quiet argument?

@statasaurus statasaurus added the enhancement New feature or request label Apr 4, 2024
@statasaurus statasaurus self-assigned this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants