resmerge.ij: File management

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/resmerge.ij.R

Description

File management function. The output file contains sample names in the first column and total leaf area (cm2) of the sample (e.g., one individual plant or one ramet) in the second column.

Usage

1
resmerge.ij(path, prefix = "\\.|-")

Arguments

path

Path to the target directory

prefix

Regular expression to manage file names

Details

The resmerge.ij combines multiple tab-delimited text files with a leaf area value (one text file for each original JPEG image file) that share the same filename 'prefix', defined as the part of the filename preceding the first hyphen (-) or period (.) that may occur (no hyphen or period is required). For example, the areas of leaf images named A123-1.jpeg.txt, A123-2.jpeg.txt, and A123-3.jpeg.txt would be combined into a single total leaf area (A123). This feature allows the user to treat multiple images as belonging to a single sample, if desired. Note that the resmerge.ij does not count the number of leaves in each image; therefore if the user requires the number of leaves per image, the user must record these values.

Value

A data frame of total leaf area for each sample

sample

Name of sample

total.leaf.area

Total leaf area of the sample (cm2)

Author(s)

Masatoshi Katabuchi <[email protected]>

See Also

run.ij readtext.ij

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#prepare example files
data(leafdata)
tf <- paste(tempdir(),"/",sep="")
for (i in 1:7){
	write.table(leafdata[[i]],paste(tf,names(leafdata)[i],sep=""),sep="\t")
}

#list of files
list.files(tf)

#combine multiple tab-delimited text files with a leaf area value 
#(one text file for each original JPEG image file) that share the same
#filename 'prefix', defined as the part of the filename preceding the first 
#hyphen (-) or period (.).
resmerge.ij(tf)

##combine multiple tab-delimited text files with a leaf area value 
#(one text file for each original JPEG image file) that share the same
#filename 'prefix', defined as the part of the filename preceding the first 
#'.txt'.
resmerge.ij(tf,prefix=".txt")

unlink(list.files(tf))

LeafArea documentation built on May 29, 2017, 7:11 p.m.