dh.getAnonPlotData: Extracts an anonymised version of serverside data which can...

View source: R/get-anon-plot-data.R

dh.getAnonPlotDataR Documentation

Extracts an anonymised version of serverside data which can be used to create bespoke plots

Description

Whilst DataSHIELD has basic plotting functionality, for publications you may need more flexiblity in creating plots. This function calls server-side functions which create an anonymised copy of the data, and returns this data in a client-side object. These values can then be used to create plots (e.g with ggplot2).

Usage

dh.getAnonPlotData(
  df = NULL,
  var_1 = NULL,
  var_2 = NULL,
  conns = NULL,
  checks = TRUE
)

Arguments

df

Character specifying a server-side data frame.

var_1

Character giving the name of a column within df for which to extract anonymised data.

var_2

Optionally, character specifying a second column within df. If a column is specified then scatter plot data will be returned with var_1 as the explanatory variable and var_2 as the outcome variable. Default is NULL which returns anonymised data only for var_1.

conns

DataSHIELD connections object.

checks

Logical; if TRUE checks are performed prior to running the function. Default is TRUE.

Details

This function can return two types of anonymised data: either anonymised data for a single variable, or scatter-plot data for two variables.

Value

A tibble in long format containing columns 'cohort', 'var_1' and optionally var_2. The values for var1 and var_2 are the anonymised data points.


lifecycle-project/ds-cs-functions documentation built on Nov. 18, 2024, 3:36 p.m.