Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/binTimeSeries.R
Groups large vectors into several bins of a given length for better (and faster) data plotting
1 | binTimeSeries(f, acqTime, nIntervals, mode = "mean", plot = TRUE)
|
f |
Numeric vector |
acqTime |
Point acquisition rate (in seconds) |
nIntervals |
Number of intervals into which the vector will be grouped |
mode |
Set to "mean" (default) or "sum" to average or sum all the points in every interval, respectively |
plot |
Boolean, set to TRUE (default) to plot the result |
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.
A data frame with two variables (Counts and Time) and 'nIntervals' observations
Alejandro Linares
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ### 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.