dh.localProxy: Generate a local proxy dataframe to enable local...

View source: R/local-proxy.R

dh.localProxyR Documentation

Generate a local proxy dataframe to enable local auto-completion in RStudio

Description

If you have a remote dataframe on the servers, it can be challenging to remember variable names when writing code. Because the dataframes are on remote servers, auto-complete won't work in RStudio. The purpose of this function is to create a local object that has the same structure as the remote data frame and enables the use of autocomplete when writing DataSHIELD code.

Usage

dh.localProxy(df = NULL, conns = NULL, checks = TRUE)

Arguments

df

Character specifying a server-side data frame.

conns

DataSHIELD connections object.

checks

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

Details

If you have a dataframe "D" with columns LAB_TSC, DIS_CVA and DIS_DIAB, normally you would need to write:

ds.summary("D$LAB_TSC") with the variable name spelled correctly (no autocomplete!) and remember quotation marks. However after running this function you can type:

⁠ds.summary(D$⁠ and hit tab, and the list of variables will be displayed. Choose one and hit enter to finish up with:

ds.summary(D$LAB_TSC) - no quotation marks needed either!

Value

Creates a local proxy dataframe. Stops function if df doesn't exist or contains variables with inconsistent class across cohorts.


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