View source: R/smooth_texture_analyzer_data.R
smooth_texture_analyzer_data | R Documentation |
Smoothes the force and pressure curves using a gaussian kernel
smooth_texture_analyzer_data(theData, sd = 0.04,cycle_col="cycle",boundary_extension_mm=0.2,lm_region_lower_mm=boundary_extension_mm,lm_region_upper_mm=boundary_extension_mm,block_size=5)
theData |
Data for the force and distance relationship. Needs to have at least the columns "direction", "Distance", "Force" and "pressure" |
sd |
Standard deviation for the Gaussian kernel, in the same units as the Distance column |
cycle_col |
Column indicating compression cycles, for data analyzed by detect_compression_cycles. Defaults to a column named "cycle", but if this column cannot be found in |
boundary_extension_mm |
To correct for boundary effects, use linear extension beyond the measured region. This should be typically a few standard deviations |
lm_region_lower_mm |
Region used to establish the linear regression for the extension at the lower |
lm_region_upper_mm |
Region used to establish the linear regression for the extension at the upper |
block_size |
For optimization of calculation time in the smoothing calculation, it is possible to carry out the smoothing block-wise. See gaussianSmoothingBlock and gaussianSmoothingSlopeBlock for details. Provide |
Calls gaussianSmoothing internally
Variable of the same structure and values as the theData
argument, with the following changes:
- Force column now contains smoothened values
- pressure column now contains smoothened values
-new column ForceSlope, which contains the smoothened, momentaneous slope (delta Force / delta Distance)
- new column pressureSlope, which contains the smoothened, momentaneous slope (delta pressure / delta distance)
Thomas Braschler
data(sampleGel) plot(Force ~ Distance, sampleGel,type="l") sampleGelSmooth=smooth_texture_analyzer_data(sampleGel, sd = 0.05,lm_region_upper_mm=0.05) plot.xy(xy.coords(sampleGelSmooth$Distance,sampleGelSmooth$Force),type="l",col="red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.