mapToList: Convert map from data.frame or DataFrame to list and vice...

View source: R/mapToList.R

listToMapR Documentation

Convert map from data.frame or DataFrame to list and vice versa

Description

The mapToList function provides a convenient way of reordering a data.frame to a list. The listToMap function does the opposite by taking a list and converting it to DataFrame.

Usage

listToMap(listmap, fill = TRUE)

mapToList(dfmap, assayCol = "assay")

Arguments

listmap

A named list object containing DataFrames with "primary" and "colname" columns

fill

logical(1) Whether to fill the map with an empty DataFrame when empty elements are present in the input list

dfmap

A data.frame or DataFrame object with identifiers in the first column

assayCol

A character vector of length one indicating the assay names column

Value

A DataFrame class object of names

A list object of DataFrames for each assay

Functions

  • listToMap(): The inverse of the listToMap operation

Examples

example("MultiAssayExperiment")

## Create a sampleMap from a list using the listToMap function
sampMap <- listToMap(maplist)

## The inverse operation is also available
maplist <- mapToList(sampMap)

vjcitn/biocMultiAssay documentation built on Nov. 24, 2024, 3:04 a.m.