-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Description
Feature description
When subsetting a teal_report object with [.teal_report function, the cards should also be subsetted.
There are some questions to solve as there is no 1-1 relationship between code that is subsetted and cards (there might be text/outputs/....)
Topics to discuss:
- Should we keep manual cards & outputs (@m7pr thinks so)
- Alternative: generate
teal_cardsfrom code (maybe using.code_to_card)?
- Alternative: generate
Mock tests below:
test_that("Subsetting teal_report also subsets teal_cards", {
q <- within(teal_report(), {
data1 <- iris
data2 <- mtcars
summary(data1)
summary(data2)
})
q2 <- q["data1"]
expect_equal(
teal_card(q2),
teal_card(q)[c(1,3, 4)]
# Q: should we keep the output of the code
)
})
test_that("Subsetting teal_report also subsets teal_cards", {
q <- within(teal_report(), {
data1 <- iris
data2 <- mtcars
summary(iris)
summary(mtcars)
})
teal_card(q) <- c(teal_card(q), "My first manual card")
q2 <- q["data1"]
# Q: should we keep the manual cards
})Code of Conduct
- I agree to follow this project's Code of Conduct.
Contribution Guidelines
- I agree to follow this project's Contribution Guidelines.
Security Policy
- I agree to follow this project's Security Policy.
Reactions are currently unavailable