Learn R Programming

tofsims (version 1.0.2)

binning: binning

Description

binning

Usage

binning(object, binningFactor, ...)

## S3 method for class 'MassImage': binning(object, binningFactor = 2)

Arguments

object
object of class MassImage
binningFactor
numeric factor for binning (2, 4, etc)
...
additional args

Value

  • binned object of class MassImage

Details

bining is used to reduce the resolution/size of MassImage objects. Optionally mclapply from the parallel package is used to speed up processing time.

Examples

Run this code
library(BiocParallel)
testImage<-MassImage('dummy')
par(mfcol=c(1,2), oma=c(0,0,0,0), mar=c(0,0,0,0))
image(testImage)
## the following param will cause to run non parallel
register(SerialParam(), default=TRUE)
testImage <- binning(testImage,binningFactor = 4)
image(testImage)
library(tofsimsData)
data(tofsimsData)
par(mfcol=c(1,2), oma=c(0,0,0,0), mar=c(0,0,0,0))
image(testImage)
testImage <- binning(testImage,binningFactor = 4)
image(testImage)

Run the code above in your browser using DataLab