View source: R/detect_compression_cycles.R
detect_compression_cycles | R Documentation |
Detects cycle of back-and-forth movement in texture Analyzer data
detect_compression_cycles(textureAnalyzerData,do_aggregation=TRUE)
textureAnalyzerData |
Data as read by read_texture_analyzer_tab |
do_aggregation |
Whether or not to do aggregation. If TRUE, aggregate by the |
The routine looks for up and down movements by analyzing the "Distance" column in the textureAnalyzerData
data frame.
The same dataframe that was passed to the function, with two supplementary (or overwritten) columns: "direction" indicates the current movement, "cycle" indicates the current compression cycle.
Thomas Braschler
# This is destructive testing on a classical (nanoporous) CMC gel, for illustration of the multi-cycle analysis path = system.file('sampleData', package = 'textureAnalyzerGels'); sampleGel=detect_compression_cycles(read_texture_analyzer_tab(paste(path,"sampleDataMultipleCycles.tab",sep="/"),chuck_diameter=4e-3,aggregate_by=FALSE)) sampleGelSmooth = smooth_texture_analyzer_data(sampleGel,boundary_extension_mm=0.2,sd=0.0025) cycle = 1 col=palette()[cycle] plot(pressure ~ Distance, sampleGelSmooth[sampleGelSmooth$cycle==cycle ,],type="l",col=col,ylim=c(-750,1250),xlim=c(0,8),ylab="Stress [Pa]",xlab="Compression [mm]") for(cycle in 2:max(sampleGelSmooth$cycle)) { col=palette()[cycle] lines(pressure ~ Distance, sampleGelSmooth[sampleGelSmooth$cycle==cycle ,],type="l",col=col,ylim=c(-500,1000)) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.