#Make a divided data frame
list <-
heart_disease %>%
divide(
Sex,
HeartDisease,
ChestPain
)
#Bind without creating names
list %>%
fasten
#Bind with names
list %>%
fasten(
into = c("Sex", "HeartDisease", "ChestPain")
)
#Only retain "Sex"
list %>%
fasten(
into = "Sex"
)
#Only retain "HeartDisease"
list %>%
fasten(
into = c("", "HeartDisease")
)
#Bind up to Sex
list %>%
fasten(
into = c("HeartDisease", "ChestPain"),
depth = 1
)
#Same thing, but start at the leaves
list %>%
fasten(
into = c("HeartDisease", "ChestPain"),
depth = -2
)
#Too large of depth returns original list
list %>%
fasten(
depth = 100
)
#Too small of depth goes to 0
list %>%
fasten(
depth = -100
)
Run the code above in your browser using DataLab