marginalFilter {ggcyto} | R Documentation

## Generate a marginal gate.

### Description

It simply constructs an boundaryFilter that removes the marginal events. It can be passed directly to ggcyto constructor. See the examples for details.

### Usage

    marginalFilter(fs, dims, ...)

### Arguments

`fs` | flowSet (not used.)
`dims` | the channels involved
`...` | arguments passed to boundaryFilter

### Value

an boundaryFilter

### Examples

    data(GvHD)
    fs <- GvHD[1]
    chnls <- c("FSC-H", "SSC-H")
    #before removign marginal events
    summary(fs[, chnls])

    # create merginal filter
    g <- marginalFilter(fs, chnls)
    g

    #after remove marginal events
    fs.clean <- Subset(fs, g)
    summary(fs.clean[, chnls])

    #pass the function directly to ggcyto
    dataDir <- system.file("extdata",package="flowWorkspaceData")
    gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE))
    # with marginal events
    ggcyto(gs, aes(x = CD4, y = CD8), subset = "CD3+") + geom_hex(bins = 64)

    # using marginalFilter to remove these events
    ggcyto(gs, aes(x = CD4, y = CD8), subset = "CD3+", filter = marginalFilter) + geom_hex(bins = 64)

[Package ggcyto version 1.15.2 Index]