detectCycle | R Documentation |
Detects breathing cycles (negative peaks with smoothing methods). A breaking cycle begins half of an inspiration, then a full expiration, then an last half of inspiration
detectCycle(
df,
minExpi = NULL,
maxInspi = NULL,
smoothMethod = "MovingAverage",
method = "MAD",
halfWindowSize = 5,
timePeriod = NULL,
SNR = 0,
minimalDuration = 2,
forMinExpiDivideMaxIntBy = 4,
forMaxInspiDivideMaxIntBy = 5,
mobileMinExpi = NULL,
mobileMaxInspi = NULL,
mobileK = 1
)
df |
dataframe with two columns whose colnames are 'intensity','time' |
minExpi |
minimal value for an expiry intensity to be detected as an expiry (blue dotted line in the plot). |
maxInspi |
maximal intensity of the original curve required to be considered as a breathing peak (purple dotted line in the plot) |
smoothMethod |
smoothing method. Among "MovingAverage" or "SavitzkyGolay". See MSnbase::smooth for more details. |
method |
method to estimate the noise "MAD" or "" in the spectra |
halfWindowSize |
required for the smoothing method. Integer corresponding to the half window size to consider. |
timePeriod |
vector containing the first and last value to attribue to the breathing cycle (start and end of tasting for example). Default to min(time) and max(time) |
SNR |
signal noise ratio (0 by default) required to be considered as a peak |
minimalDuration |
minimalDuration of a breathing cycle (2 by default - as a accelerated breathing frequency corresponds to 20 cycles and more by minut and a low frequency is 12 and less -) |
forMinExpiDivideMaxIntBy |
default to 5. When minExpi is null, it is evaluated as the ratio of the maximal intensity and forMinIntensityDivideMaxIntBy |
forMaxInspiDivideMaxIntBy |
default to 5. When minExpi is null, it is evaluated as the ratio of the maximal intensity and forMinIntensityDivideMaxIntBy |
mobileMinExpi |
default to NULL, ifelse an integer higher than 3. If not NULL, the minimal intensity required for an expiration is a mobile one, defined by an mobile average (on the number of points defined in mobileMinExpi) + mobileK * mobile standard deviations (on the same number of points) |
mobileMaxInspi |
default to NULL, ifelsea integer higher than 3. If not NULL, the maximal intensity required for an inspiration is a mobile one, defined by an mobile average (on the number of points defined in mobileMinExpi) - mobileK * mobile standard deviations (on the same number of points) |
mobileK |
default to 1. a number to be used in mobileMinExpi or mobileMaxInspi if not NULL |
a list containing the times corresponding to cycle limits (cycles), some plots the reversed smoothed data used for detecting peaks (gg$p2) and raw data with the cycle limits (gg$p3), a table containing information about the selected peaks: finalPeakTable and a table containing all the peaks detected before any filter (peakTable)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.