inner_join.trackr_df {dtrackr} | R Documentation |
Inner joins
Description
Mutating joins behave as dplyr
joins, except the history graph of the two
sides of the joins is merged resulting in a tracked dataframe with the
history of both input dataframes. See dplyr::inner_join()
for more details
on the underlying functions.
Usage
## S3 method for class 'trackr_df'
inner_join(
x,
y,
...,
.messages = c("{.count.lhs} on LHS", "{.count.rhs} on RHS",
"{.count.out} in linked set"),
.headline = "Inner join by {.keys}"
)
Arguments
x , y |
A pair of data frames, data frame extensions (e.g. a tibble), or lazy data frames (e.g. from dbplyr or dtplyr). See Methods, below, for more details. |
... |
Other parameters passed onto methods. |
.messages |
a set of glue specs. The glue code can use any global variable, {.keys} for the joining columns, {.count.lhs}, {.count.rhs}, {.count.out} for the input and output dataframes sizes respectively |
.headline |
a glue spec. The glue code can use any global variable, {.keys} for the joining columns, {.count.lhs}, {.count.rhs}, {.count.out} for the input and output dataframes sizes respectively |
Value
the join of the two dataframes with the history graph updated.
See Also
dplyr::inner_join()
Examples
library(dplyr)
library(dtrackr)
# Joins across data sets
# example data uses the dplyr starways data
people = starwars %>% select(-films, -vehicles, -starships)
films = starwars %>% select(name,films) %>% tidyr::unnest(cols = c(films))
lhs = people %>% track() %>% comment("People df {.total}")
rhs = films %>% track() %>% comment("Films df {.total}") %>%
comment("a test comment")
# Inner join
join = lhs %>% inner_join(rhs, by="name", multiple = "all") %>% comment("joined {.total}")
# See what the history of the graph is:
join %>% history() %>% print()
nrow(join)
# Display the tracked graph (not run in examples)
# join %>% flowchart()