listToMap {MultiAssayExperiment} | R 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, type = "colnames")

    mapToList(dfmap, assayCol = "assay")

### Arguments

`listmap` | A named `list` object containing either experiments (`assay`s), samples (`colname`s) or features (`rowname`s)
`type` | Any of the valid types of maps including colnames, rownames, and assays.
`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
    mySampleMap <- listToMap(mylist)

    ## The inverse operation is also available
    mylist <- mapToList(mySampleMap)

[Package MultiAssayExperiment version 1.6.0 Index]