
Last chance! 50% off unlimited learning
Sale ends in
Groups large vectors into several bins of a given length for better (and faster) data plotting
binTimeSeries(f, acqTime, nIntervals, mode = "mean", plot = TRUE)
Numeric vector
Point acquisition rate (in seconds)
Number of intervals into which the vector will be grouped
Set to "mean" (default) or "sum" to average or sum all the points in every interval, respectively
Boolean, set to TRUE (default) to plot the result
A data frame with two variables (Counts and Time) and 'nIntervals' observations
This function groups all the points in the vector 'f' into 'nIntervals' bins of length = length(f)/nIntervals. Then, averages or sums all of the points in each bin and plots the result.
# NOT RUN {
### Please navigate to
### (https://github.com/FCSlib/FCSlib/tree/master/Sample%20Data)
### to find this sample data
# Automatic plot
x <- readFileTiff("Cy5.tif")
x <- as.vector(x)
x <- binTimeSeries(x[length(x):1], 2e-6, 100, mode = "mean", plot = T)
# Manual plot (useful for adding custom labels)
x <- readFileTiff("Cy5.tif")
x <- as.vector(x)
x <- binTimeSeries(x[length(x):1], 2e-6, 100, mode = "mean", plot = F)
plot(x$Counts~x$Time, type = "l")
# }
Run the code above in your browser using DataLab