library(knitr) knitr::opts_chunk$set(cache = TRUE, warning = FALSE, message = FALSE, cache.lazy = FALSE) library(dplyr) library(tidygate)
It interactively or programmately labels points within custom gates on two dimensions, according to tidyverse principles. The information is added to your tibble. It is based on the package gatepoints
from Wajid Jawaid.
The main benefits are
Input (tibble)
element | dimension1 | dimension2 | annotations |
------------ | ------------- | ------------- | -------------
chr
or fctr
| chr
or fctr
| numeric
| ...
Command input %>% gate(element, dimension1, dimension2)
Output (tibble)
element | dimension1 | dimension2 | annotations | Gate |
------------ | ------------- | ------------- | ------------- | -------------
chr
or fctr
| chr
or fctr
| numeric
| ... | ...
The standard way to gate points in a two-dimensional plot is to - Interactively draw an arbitrary number of gates - Click "Finish" button on the top-right corner of the plot
tidygate_gate <- tidygate_data %>% mutate( gate = gate_chr( Dim1, Dim2 ) ) tidygate_gate
Gates are saved in a temporary file for later use
my_gates = tidygate::gate_list my_gates
We can use previously drawn gates to programmately add the gate column
tidygate_data %>% mutate( gate = gate_chr( Dim1, Dim2, # Pre-defined gates gate_list = my_gates ))
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.