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_cards from code (maybe using .code_to_card)?
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
Contribution Guidelines
Security Policy
Feature description
When subsetting a
teal_reportobject with[.teal_reportfunction, 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:
teal_cardsfrom code (maybe using.code_to_card)?Mock tests below:
Code of Conduct
Contribution Guidelines
Security Policy