Description Usage Arguments Value See Also Examples
Please see vignette('DependencySorting', package = 'replyr')
and vignette('joinController', package= 'replyr')
for more details.
1 2 3 4 5 6 7 8 9 10 11 12 |
tDesc |
description of tables, either a |
columnJoinPlan |
columns to join, from |
... |
force later arguments to bind by name. |
checkColumns |
logical if TRUE confirm column names before starting joins. |
computeFn |
function to call to try and materialize intermediate results. |
eagerCompute |
logical if TRUE materialize intermediate results with computeFn. |
checkColClasses |
logical if true check for exact class name matches |
verbose |
logical if TRUE print more. |
dryRun |
logical if TRUE do not perform joins, only print steps. |
tempNameGenerator |
temp name generator produced by wrapr::mk_tmp_name_source, used to record dplyr::compute() effects. |
joined table
tableDescription
, buildJoinPlan
, inspectDescrAndJoinPlan
, makeJoinDiagramSpec
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # example data
meas1 <- data.frame(id= c(1,2),
weight= c(200, 120),
height= c(60, 14))
meas2 <- data.frame(pid= c(2,3),
weight= c(105, 110),
width= 1)
# get the initial description of table defs
tDesc <- rbind(tableDescription('meas1', meas1),
tableDescription('meas2', meas2))
# declare keys (and give them consitent names)
tDesc$keys[[1]] <- list(PatientID= 'id')
tDesc$keys[[2]] <- list(PatientID= 'pid')
# build the column join plan
columnJoinPlan <- buildJoinPlan(tDesc)
# decide we don't want the width column
columnJoinPlan$want[columnJoinPlan$resultColumn=='width'] <- FALSE
# double check our plan
if(!is.null(inspectDescrAndJoinPlan(tDesc, columnJoinPlan,
checkColClasses= TRUE))) {
stop("bad join plan")
}
# execute the left joins
executeLeftJoinPlan(tDesc, columnJoinPlan,
checkColClasses= TRUE,
verbose= TRUE)
# also good
executeLeftJoinPlan(list('meas1'=meas1, 'meas2'=meas2),
columnJoinPlan,
checkColClasses= TRUE,
verbose= TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.