read_texture_analyzer_tab: read_texture_analyzer_tab

View source: R/read_texture_analyzer_tab.R

read_texture_analyzer_tabR Documentation

read_texture_analyzer_tab

Description

Reads a texture analyzer file from the disk. The units are assumed to mm for the distance, and g for the force

Usage

read_texture_analyzer_tab(file, chuck_diameter = 0.004,aggregate_by="Distance",downup=TRUE,dec=".",skip_lines=1,unit_line=1,sep="",Force_column="Force",Distance_column="Distance",use_fill_for_read_table=FALSE)

Arguments

file

File path for the tabulated text file.

chuck_diameter

Diameter of the chuck used to compress the gel. Indication in meters, the chuck is assumed to be circular.

aggregate_by

Column to be used for aggregation. Provide FALSE if no aggregation is desired. If aggregate_by="Time" is indicated, the Time column will be rounded to integers prior to aggregation

downup

Chuck displacement down (compression) followed by equal movement up (release)?

dec

Decimal point when reading the text files

skip_lines

Possibility to skip lines in front of the actual to data to read

unit_line

Is there a line in the text file (after the variable names) that contains unit information? If yes pass 1, otherwise 0

sep

Separator to be passed to read.table

Force_column

Name of the column where the force is stored. The expected unit is grams for now

Distance_column

Name of the column where the distance travelled by the chuck is stored. The expected unit is mm for now

use_fill_for_read_table

Set the fill argument to read.table, used internally. Provide TRUE if there are incomplete lines in the .tab files that should be completed with empty columns

Details

The routine expects the file to contain force data from both the downward trajectory and the upward trajectory; it assigns the first half of the points to the down trajectory, and the second half to the up trajectory

Value

Dataframe with the following columns:

Distance

Distance of downward movement of the chuck, as given by the texture analyzer; the units are expected to be in mm

Force

Force as measured by the Texture Analyzer, in grams

direction

Interpretation in terms of downward and upward movement, possible values are "down" and "up"

Time

Time of acquisition, as given by the Texture Analyzer

pressure

Calculated pressure (stress) exercised by the chuck; since pressure is given by force / area, the area is estimated from the chuck_diameter argument

Author(s)

Thomas Braschler

Examples

path = system.file('sampleData', package = 'textureAnalyzerGels');
sampleGel = read_texture_analyzer_tab(paste(path,"sampleGel.tab",sep="/"),chuck_diameter=4e-3)

tbgitoo/textureAnalyzerGels documentation built on March 30, 2022, 4:53 a.m.