#### Viewing/User Interface to GADSlist
#############################################################################
#' Variable names of Hierarchical data list.
#'
#' Function to get the names of a hierarchical data list.
#'
#' Get variable names of a Hierarchically structured data list, optionally as a list, sorted by
#' subdata frame.
#'
#'@param GADSlist Hierarchical List of data Sets
#'@param asVector Logical value indicating whether output should be a plain character vector or list
#'
#'@return Returns a plain character vector or a list of character vector with the hierarchical structure of the data list.
#'
#'@examples
#'# Example data set
#'to be done
#'
GADSnames <- function(GADSlist, asVector = F) {
checkGADSlist(GADSlist)
nameList <- lapply(GADSlist, function(i) names(i))
if(isTRUE(asVector)) return(do.call(c, nameList))
nameList
}
#### Modifying GADSlist
#############################################################################
# set Names for Gadslist (modification in place!)
#' Change variables names of Hierarchical data list.
#'
#' Sets variables names (modification in place) of a Hierarchical data list.
#'
#' Changes variables names of a Hdl via reference to old names, independent of which sub data set the variables are in.
#' Names have to be in the same order in both vectors.
#'
#'@param GADSlist Hierarchical List of data Sets
#'@param oldNames character vector of old variables names
#'@param newNames character vector containing the new variable names
#'
#'@return Returns nothing. Variable names of input GADSlist are altered.
#'
#'@examples
#'# Example data set
#'to be done
#'
setNamesGADS <- function(GADSlist, oldNames, newNames) {
nameDF <- data.frame(old = oldNames, new = newNames)
for(i in seq_along(GADSlist)) {
changer <- nameDF[nameDF$old %in% names(GADSlist[[i]]), ]
if(nrow(changer) > 0) setnames(GADSlist[[i]], old = as.character(changer$old), new = as.character(changer$new))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.