Learn R Programming

imageData (version 0.1-21)

importExcel: Imports an Excel imaging file and allows some renaming of variables

Description

Uses XLConnect to import a sheet of imaging data produced by the Lemna Tec Scanalyzer. Basically, the data consists of imaging data obtained from a set of pots or carts over time. There should be a unique identifier for each cart, which by default is Snapshot.ID.Tag and a column labelled Snapshot.Time.Stamp, which reflects the time of the imaging pertaining to the data values values in the row of a sheet. Also, Time.After.Planting..d. can be caclulated, or recaclulated if already prsent, from Snapshot.Time.Stamp by subtracting a supplied time of planting. If the data is prefixed by 'RGB_SV1', 'RGB_SV2' or 'RGB_TV', the 'RGB_' can be removed and the 'SV1', 'SV2' or 'TV' becomes a suffix.

Usage

importExcel(file, sheet="raw data", prefix2suffix = TRUE, planting.time = NULL, timeformat = "%Y-%m-%d %H:%M", imagetimesPlot = TRUE)

Arguments

file
A character giving the path and name of the file containing the data.
sheet
A character giving the name of the sheet containing the data, that must include columns named Snapshot.ID.Tag, which uniquely indexes the carts in the experiment, and Snapshot.Time.Stamp, which reflects the time of the imaging from which a particular data value was obtained. It is also assumed that a column named Time.after.Planting..d. is in the sheet or that it will be calculated from Snapshot.Time.Stamp using the value of planting.time supplied in the function call.
prefix2suffix
A logical specifying whether the variables names prefixed by "RGB_SV1", "RGB_SV2" or "RGB_TV" have these prefixes replaced by the suffices ".SV1", ".SV2" or ".TV", respectively.
planting.time
A character giving the time of planting, in the POSIXct format timeformat, to be subtracted from Snapshot.Time.Stamp in recalculating Time.After.Planting..d.. If planting.time is NULL then Time.After.Planting..d. is not recalculated.
timeformat
A character giving the POSIXct format of characters containing times, in particular Snapshot.Time.Stamp and planting.time.
imagetimesPlot
A logical indicating whether a plot of the imaging times against the recalculated Time.After.Planting..d.. It aids in checking Time.After.Planting..d. and what occurred in imaging the plants.

Value

data.frame containing the data.

See Also

as.POSIXct