x <- pair_links(
# group on the left hand only
c("a", "b"),
# normally, integer index will be interpreted as the index of the
# origianl data
1:2,
# wrapped with `I()` indicate` the integer index is ordering of the
# layout
I(1:2),
range_link(1, 6),
range_link("a", "b"),
# group on the right hand only
~ 1:2,
~ c("a", "b"),
~ range_link(1, 6),
# group on the both side
range_link(1, 6) ~ c("a", "b"),
# waiver() indicates the right hand is the same of the left hand
range_link(1, 6) ~ waiver(),
# the same for the left hand
waiver() ~ 1:2,
~NULL # an empty link
)
x
# we can modify it as usual list
x[[1]] <- NULL # remove the first link
x$a <- ~LETTERS
x
# modify with a list
x[1:2] <- list(~ c("a", "b"), ~ range_link("a", "b"))
x
Run the code above in your browser using DataLab