R/dssShowFactors.R

Defines functions dssShowFactors

Documented in dssShowFactors

#' @title Describe factors in a dataframe
#' @description Show the levels for all the factors in a remote dataframe
#' @param what a character name of the dataframe
#' @param show.all a logical, default FALSE. If FALSE it limits to the first 50 levels, otherwise it returns all of them.
#' @param async a logical, see datashield.aggregate

#' @param  datasources a list of opal objects obtained after logging into the opal servers (see datashield.login)
#' @export
#'

dssShowFactors <- function(what, show.all = FALSE,async = TRUE, datasources = NULL){
  if(is.null(datasources)){
    datasources <- datashield.connections_find()
  }
  limit.levels <- as.character(!show.all)
  expr <- paste0('showInfo(', what, ',"', limit.levels, '")')
  out <- datashield.aggregate(datasources, as.symbol(expr), async = async)
  return(out)

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