Last data update: 2014.03.03

R: Apply a function over the intensities in a cytoSet
csApplyR Documentation

Apply a function over the intensities in a cytoSet

Description

This a wrapper for sapply for objects of class cytoSet.

Usage

csApply(X, FUN, ..., simplify = TRUE)

Arguments

X

cytoSet.

FUN

the function to be applied.

...

optional arguments to FUN.

simplify

logical; should the result be simplified to a vector or matrix if possible? Gets passed on the sapply.

Details

A wrapper for sapply.

Value

Like sapply: If FUN always returns a scalar, then the value of this function is a named vector. If FUN always returns a vector of length n, then the value of this function is an n x length(X) matrix with dimnames. Else, the value of this function is a named list whose values are the return values of the individual calls to FUN.

Author(s)

Wolfgang Huber http://www.ebi.ac.uk/huber

See Also

sapply

Examples

cset=readCytoSet(path=system.file("extdata", package="prada"),
  pattern="[A-Z][0-9][0-9]$")
csApply(cset, nrow)
csApply(cset, colMeans)

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(prada)
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")'.

Loading required package: RColorBrewer
Loading required package: grid
Loading required package: rrcov
Loading required package: robustbase

Attaching package: 'robustbase'

The following object is masked from 'package:Biobase':

    rowMedians

Scalable Robust Estimators with High Breakdown Point (version 1.3-11)

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/prada/csApply.Rd_%03d_medium.png", width=480, height=480)
> ### Name: csApply
> ### Title: Apply a function over the intensities in a cytoSet
> ### Aliases: csApply
> ### Keywords: manip
> 
> ### ** Examples
> 
> cset=readCytoSet(path=system.file("extdata", package="prada"),
+   pattern="[A-Z][0-9][0-9]$")
> csApply(cset, nrow)
fas-Bcl2-plate323-04-04.A01 fas-Bcl2-plate323-04-04.A02 
                       2115                        2400 
fas-Bcl2-plate323-04-04.A03 fas-Bcl2-plate323-04-04.B01 
                       2040                        1485 
fas-Bcl2-plate323-04-04.B02 fas-Bcl2-plate323-04-04.B03 
                       2055                        2040 
> csApply(cset, colMeans)
      fas-Bcl2-plate323-04-04.A01 fas-Bcl2-plate323-04-04.A02
FSC-H                 452.2184397                   446.56458
SSC-H                 402.5494090                   406.71792
FL1-H                  57.4491726                    61.80458
FL2-H                 127.4260047                   132.43708
FL3-H                  11.0061466                    12.41500
FL2-A                   0.1432624                     0.02250
FL4-H                 441.4808511                   438.07500
Time                  279.6241135                   273.40000
      fas-Bcl2-plate323-04-04.A03 fas-Bcl2-plate323-04-04.B01
FSC-H                452.57303922                436.70033670
SSC-H                398.89803922                403.28956229
FL1-H                 52.42696078                 50.32929293
FL2-H                119.30147059                118.57643098
FL3-H                  9.74950980                 10.57845118
FL2-A                  0.01862745                  0.03501684
FL4-H                420.41862745                451.87744108
Time                 271.73529412                202.14141414
      fas-Bcl2-plate323-04-04.B02 fas-Bcl2-plate323-04-04.B03
FSC-H                 415.6618005                413.13823529
SSC-H                 377.8048662                352.24607843
FL1-H                  54.2330900                 50.28137255
FL2-H                 120.4880779                115.37794118
FL3-H                  12.8321168                 12.00980392
FL2-A                   0.0379562                  0.02107843
FL4-H                 468.5070560                463.60196078
Time                  275.9051095                275.30882353
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>