Learn R Programming

cytofan

cytofan implements the concept of fan plots (Britton, E.; Fisher, P. & J. Whitley (1998) The Inflation Report Projections: Understanding the Fan Chart) for cytometry data in ggplot2.

The cytofan package was implemented following up on a gist written shortly after the fanplot package was released. Compared to ggfan, cytofan uses categorical data as input on the x axis.

Installation

You can install cytofan from github with:

# install.packages("devtools")
devtools::install_github("yannabraham/cytofan")

Example

cytofan can be used to visualize differences between populations identifed using mass cytometry:

library(cytofan)
#> Loading required package: ggplot2
library(bodenmiller)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(tidyr)

data("refPhenoMat")
data("refAnnots")

bind_cols(refAnnots,
          as.data.frame(refPhenoMat)) %>%
  filter(Cells %in% c('cd4+','cd8+','igm+','igm-')) %>%
  gather("Channel","value",
         any_of(colnames(refPhenoMat))) %>%
  ggplot(aes(x=Channel,y=value))+
  geom_fan()+
  facet_grid(Cells~.)

Copy Link

Version

Install

install.packages('cytofan')

Monthly Downloads

174

Version

0.1.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Yann Abraham

Last Published

April 8th, 2025

Functions in cytofan (0.1.1)

cytofan

cytofan: An implementation of Fan plots in ggplot2.
StatFan

StatFan
geom_fan

Fan plots for trend and population visualizations
do_fan

Compute summary statistics for stat_fan