read_texture_analyzer_tab_list: read_texture_analyzer_tab_list

View source: R/read_texture_analyzer_tab_list.R

read_texture_analyzer_tab_listR Documentation

read_texture_analyzer_tab_list

Description

Reads a series of texture analyzer tab files

Usage

read_texture_analyzer_tab_list(file_info,root_folder,folder_column="Folder",file_column="File",
         chuck_diameter_column="diameter_mm",do_plot=TRUE,do_smoothing=TRUE,lines_to_read=NULL,
         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_info

Dataframe describing the files to be read. Needs to contain at least the following columns: 1. A folder column, describing the sub-folder where the individual files are located. The name of this column is given by the argument folder_column. 2. A file column indicating the filename of the file to be read. The name of this column is given by file_column. 3. A chuck or gel diameter column, where the diameter of the chuck or gel is indicated (whichever is smaller, basically). The name of this column is given by the chuck_diameter_column argument.

root_folder

Common root folder where all the tab-files to be read are located.

folder_column

Name of the column in file_info that contains the folder location.

file_column

Name of the column in file_info that contains the filename.

chuck_diameter_column

Name of the column in file_info that contains the relevant chuck/gel diameters. The chuck or gel diameters should be in millimeters.

do_plot

Indicates whether or not plots should be drawn while reading the files

do_smoothing

Indicates whether or not smoothing by smooth_texture_analyzer_data should be performed when reading the files

lines_to_read

Possibility to restrict the lines to be read, a numerical vector indicating the lines to be read.

aggregate_by

Aggregation argument passed to read_texture_analyzer_tab, used internally

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

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

sep

Separator to be passed to read.table

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

...

Additional arguments to be passed to smooth_texture_analyzer_data. These arguments should be named according to the arguments given in smooth_texture_analyzer_data

Details

The function will run through all the lines of file_info and read the file specified by the file and folder columns (which need to be located within folder given by the root_folder argument). To do so, it uses read_texture_analyzer_tab, and, if do_smoothing is TRUE, smooth_texture_analyzer_data as well. If do_plot is true, it will plot the data for each line as well. The lines_to_read argument can be used to restrict the file reading to certain lines; this is primarily for debugging purposes, as the function may take quite a long time if there are many entries in file_info.

Value

A list with as many elements as there are rows in file_info. Each element in the list is the output of read_texture_analyzer_tab, optionally processed by smooth_texture_analyzer_data

Author(s)

Thomas Braschler, Patrick Burch

Examples

path = system.file('sampleData/2016_08_30_Patrick_sample', package = 'textureAnalyzerGels');
CMC_concentration_file_info = read.xls(file.path(path,"file_listing.xlsx") )
CMC_concentration_data=read_texture_analyzer_tab_list(file_info=CMC_concentration_file_info,root_folder=path,sd=0.05,boundary_extension_mm=0.2,lm_region_upper_mm=0.05)



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