Last data update: 2014.03.03

R: Set some default parameters for ggcyto
ggcyto_par_setR Documentation

Set some default parameters for ggcyto

Description

Use this function to modify ggcyto parameters These are the regular (or to be instantiated as) scales, labs, facet objects. They can be added as a single layer to the plot for the convenience.

Usage

ggcyto_par_set(...)

Arguments

...

a list of element name, element pairings that modify the existing parameter settings

Value

a list of new settings for ggycto

elements

The individual elements are:

limits can be "data"(default) or "instrument" or a list of numeric limits for x and y (e.g. list(x = c(0, 4000)))
facet the regular facet object
hex_fill default scale_fill_gradientn for geom_hex layer
lab labs_cyto object

Examples

library(ggcyto)
dataDir <- system.file("extdata",package="flowWorkspaceData")
gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE))

p <- ggcyto(gs, aes(x = CD4, y = CD8), subset = "CD3+")
# 2d plot
p <- p + geom_hex(bins = 64)
p

#use instrument range by overwritting the default limits settings
p + ggcyto_par_set(limits = "instrument")

#manually set limits
myPars <- ggcyto_par_set(limits = list(x = c(0,3.2e3), y = c(-10, 3.5e3)))
 p  + myPars# or xlim(0,3.2e3) + ylim(-10, 3.5e3)

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(ggcyto)
Loading required package: ggplot2
Loading required package: flowCore
Loading required package: ncdfFlow
Loading required package: flowViz
Loading required package: lattice
Loading required package: RcppArmadillo
Loading required package: BH
Loading required package: flowWorkspace
Loading required package: gridExtra
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/ggcyto/ggcyto_par_set.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ggcyto_par_set
> ### Title: Set some default parameters for ggcyto
> ### Aliases: ggcyto_par_set
> 
> ### ** Examples
> 
> library(ggcyto)
> dataDir <- system.file("extdata",package="flowWorkspaceData")
> gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE))
loading R object...
loading tree object...
Done
> 
> p <- ggcyto(gs, aes(x = CD4, y = CD8), subset = "CD3+")
> # 2d plot
> p <- p + geom_hex(bins = 64)
> p
Warning message:
Removed 4 rows containing missing values (geom_hex). 
> 
> #use instrument range by overwritting the default limits settings
> p + ggcyto_par_set(limits = "instrument")
Warning messages:
1: Removed 12952 rows containing non-finite values (stat_binhex). 
2: Removed 25 rows containing missing values (geom_hex). 
> 
> #manually set limits
> myPars <- ggcyto_par_set(limits = list(x = c(0,3.2e3), y = c(-10, 3.5e3)))
>  p  + myPars# or xlim(0,3.2e3) + ylim(-10, 3.5e3)
Warning messages:
1: Removed 14972 rows containing non-finite values (stat_binhex). 
2: Removed 48 rows containing missing values (geom_hex). 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>