rnb.plot.pheno.categories {RnBeads} | R Documentation

## rnb.plot.pheno.categories

### Description

Generates bar charts summarizing the categorical traits in a sample annotation table.

### Usage

    rnb.plot.pheno.categories(
      annotations,
      columns = NULL,
      fileprefix = "barchart_pheno",
      report = NULL,
      color.values = rnb.getOption("colors.category")
    )

### Arguments

`annotations` | Methylation dataset as an object of type inheriting `RnBSet`, or its sample annotations in the form of a `data.frame`. If this parameter is a dataset, the annotation information is extracted using the method `pheno`.
`columns` | Optional; predefined column names (in the form of a `character` vector) or indices (an `integer` vector) to consider. All other columns in the annotation table will be ignored.
`fileprefix` | `character` vector with one element storing the file name prefix of the output files, without the extension. Only a limited set of symbols is allowed to be used in this prefix.
`report` | Report to contain the generated plots. If specified, this must be an object of type `Report`.
`color.values` | Non-empty `character` vector containing the color scheme to be mapped to the categories defined in the annotation table. Colors are recycled if necessary, that is, if the length of this vector is smaller than the number of categories in a trait.

### Details

This function identifies the traits that define sample subgroups and then generates one report plot per trait. Every report plot consists of two files. File names are formed by appending an index and file extension to `fileprefix`. Thus, the suffixes appended are `"_1.pdf"`, `"_1.png"`, `"_2.pdf"`, `"_2.png"`, ... Existing files with the generated filenames are overwritten.

### Value

List of report plots. The names in this list are the column names in the annotation table that were selected for visualization. In case no suitable categorical traits are found among the provided annotations, this function returns an empty list.

### Author(s)

Yassen Assenov

### See Also

`rnb.sample.groups` for identifying traits in the annotation table that define sample subgroups; `createReportPlot` for the allowed symbols to be used in `fileprefix`

[Package RnBeads version 2.12.2 Index]