dssJoin: Join 2 or more dataframes

View source: R/dssJoin.R

dssJoinR Documentation

Join 2 or more dataframes

Description

Applies dplyr::xxx_join on the local nodes where xxx can be any of ('inner', 'full', 'left', 'right', 'semi', 'anti')

Usage

dssJoin(
  what = NULL,
  symbol = NULL,
  by = NULL,
  join.type = "full",
  async = TRUE,
  datasources = NULL
)

Arguments

what

a vector of names of dataframes

symbol

the name of the new dataframe

by

a character or a named vector, this goes straight into the 'by' parameter of dplyr::xxx_join. If nothing is supplied, 'SUBJID' is assumed. As per the dplyr documentation, to join by different variables on x and y use a named vector. For example, by = c("a" = "b") will match x.a to y.b.

join.type

a character, the type of the join, the possible values are above. Default is 'full'

async

same as in datashield.assign

datasources

same as in datashield.assign

Value

It doesn't return anything, it creates a dataframe, the result of the join

Examples

# open a local pseudo connection:
library(DSLite)
dslite.server1 <<- newDSLiteServer(config = defaultDSConfiguration(include=c('dsSwissKnife')))
builder <- newDSLoginBuilder()
builder$append(server="server1", url='dslite.server1',driver = "DSLiteDriver")
logindata <- builder$build()
opals <- datashield.login(logins = logindata)
# load the iris dataset
datashield.aggregate(opals[1], as.symbol('partialData("iris")'))
# join iris with itself just for fun:
dssJoin(c('iris', 'iris'), symbol = 'joined_iris', by = 'Sepal.Length', join.type = 'inner', datasources = opals)
session1 <- dslite.server1$getSession(dslite.server1$getSessionIds())
str(session1$joined_iris)


sib-swiss/dsSwissKnifeClient documentation built on July 16, 2025, 6:25 p.m.