plotNA-methods {MSnbase} | R Documentation

## Exploring missing data in 'MSnSet' instances

### Description

These methods produce plots that illustrate missing data.

`is.na` returns the expression matrix of it `MSnSet` argument as a matrix of logicals referring whether the corresponding cells are `NA` or not. It is generally used in conjunction with `table` and `image` (see example below).

The `plotNA` method produces plots that illustrate missing data. The completeness of the full dataset or a set of proteins (ordered by increasing NA content along the x axis) is represented. The methods make use the `ggplot2` system. An object of class 'ggplot' is returned invisibly.

### Methods

is.na

  `signature(x = "MSnSet")`

Returns the a matrix of logicals of dimensions `dim(x)` specifiying if respective values are missing in the `MSnSet`'s expression matrix.

plotNA

  `signature(object = "MSnSet", pNA = "numeric")`

Plots missing data for an `MSnSet` instance. `pNA` is a `numeric` of length 1 that specifies the percentage of accepted missing data values per features. This value will be highlighted with a point on the figure, illustrating the overall percentage of NA values in the full data set and the number of proteins retained. Default is 1/2.

### Author(s)

Laurent Gatto <lg390@cam.ac.uk>

### See Also

See also the `filterNA` method to filter out features with a specified proportion if missing values.

### Examples

    data(msnset)
    exprs(msnset)[sample(prod(dim(msnset)), 120)] <- NA

    head(is.na(msnset))
    table(is.na(msnset))
    image(msnset)

    plotNA(msnset, pNA = 1/4)

[Package MSnbase version 2.20.1 Index]