Last data update: 2014.03.03

R: Plot bins
plotBinsR Documentation

Plot bins

Description

Plot densities of multiple bins of data, divided by a sliding window approach

Usage

plotBins(x, y, ...)

Arguments

x

the vector of numerical data to be plotted. If x is a matrix it is interpreted as a vector. x can also be of class "ExpressionSet".

y

an additional vector of numerical data to be used for binning. If y is a matrix it is interpreted as a vector. y can also be of class "ExpressionSet".

...

Arguments to be passed to methods (see plotBins-methods):

element

which element of AssayData to use for a given ExpressionSet input (default is "exprs")

sample

which element of sampleNames to use as data (default is 1). Can be a character matching a sample name or simply an integer indicating which sample to choose. See getSamples.

feature

which element of featureData to use as binning variable (default is 1). Can be a character matching varLabel or simply an integer indicating which feature to choose. See getFeatures.

num.bins

number of bins (default is 10) used to divide the data

num.steps

number of steps (default is 3) used to create bin offsets, resulting in bins of sliding windows

mode

the binning mode to be used. This must be either "continuous" or "discrete". "continuous" mode will divide the data into density-dependent bins. "discrete" mode will divide the data uniformly by binning data values.

show.avg

logical; if TRUE, plots overall density in addition to densities per bin. If FALSE (default), overall density plot is omitted.

main

an overall title for the plot: see title.

xlab

a title for the x axis: see title.

ylab

a title for the y axis: see title.

na.rm

logical; if TRUE (default), missing values are removed from x and y. If FALSE any missing values cause an error.

dots

other arguments to be passed to plot. See plot.

Author(s)

Reid F. Thompson (rthompso@aecom.yu.edu)

See Also

plotBins-methods, density, quantile

Examples

#demo(pipeline,package="HELP")

x <- 1:1000
y <- sample(1:50,size=1000,replace=TRUE)
plotBins(x,y,show.avg=TRUE,main="Random binning data",xlab="1:1000")

#rm(x,y)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HELP)
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/HELP/plotBins.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotBins
> ### Title: Plot bins
> ### Aliases: plotBins
> ### Keywords: hplot
> 
> ### ** Examples
> 
> #demo(pipeline,package="HELP")
> 
> x <- 1:1000
> y <- sample(1:50,size=1000,replace=TRUE)
> plotBins(x,y,show.avg=TRUE,main="Random binning data",xlab="1:1000")
> 
> #rm(x,y)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>