Learn R Programming

imageData (version 0.1-21)

longitudinalPrime: Selects a set variables to be retained in a data frame of longitudinal data

Description

Forms the prime traits by selecting a subset of the traits in a data.frame of imaging data produced by the Lemna Tec Scanalyzer. Add factors and explanatory variates that might be of use, including the maximum of the heigh SV1 and SV2 andf the mean of the two SV measurements for several traits.

Usage

longitudinalPrime(data, smarthouse.lev = c("SW"), calcWaterLoss = TRUE, pixelsPERcm = 18)

Arguments

data
A data.frame containing the columns: Snapshot.ID.Tag, Time.after.Planting..d., Smarthouse, Lane, Position, Genotype.ID,Treatment.1,Treatment.2,Snapshot.Time.Stamp, Weight.Before, Weight.After, Water.Amount, Projected.Shoot.Area..pixels., Area.SV1, Boundary.Points.To.Area.Ratio.SV1, Caliper.Length.SV1, Center.Of.Mass.Y.SV1, Compactness.SV1, Convex.Hull.Area.SV1, Max.Dist.Above.Horizon.Line.SV1, Area.SV2, Boundary.Points.To.Area.Ratio.SV2, Caliper.Length.SV2, Center.Of.Mass.Y.SV2, Compactness.SV2, Convex.Hull.Area.SV2, Max.Dist.Above.Horizon.Line.SV2, Area.TV, Boundary.Points.To.Area.Ratio.TV, Caliper.Length.TV, Compactness.TV, Convex.Hull.Area.TV.
smarthouse.lev
A character vector giving the levels to use for the Smarthouse factor.
calcWaterLoss
A logical indicating whether to calculate the Water.Loss. If it is FALSE, it is assumed that it is already in data.
pixelsPERcm
A numeric giving the number of pixels per cm for the images.

Value

data.frame containing the columns:
  1. Smarthouse: factor with levels for the Smarthouse
  2. Lane: factor for lane number in a smarthouse
  3. Position: factor for east/west position in a lane
  4. Days: factor for the number of Days After Planting (DAP)
  5. Snapshot.ID.Tag: unique code for each cart
  6. Reps: factor indexing the replicates for each genotype (calculated)
  7. Snapshot.Time.Stamp: time at which an image was taken in POSIXct format
  8. xPosn: numeric for the Positions within a Lane (calculated)
  9. Hour: hour of the day, to 2 decimal places, at which the image was taken (calculated)
  10. xDays: numeric for the DAP that is centred by subtracting the mean of the unique days (calculated)
  11. Genotype.ID: factor for the genotype names
  12. Treatment.1: factor for the treatments with levels being the names of the treatments
  13. Weight.Before: weight of the pot before watering
  14. Weight.After: weight of the pot after watering
  15. Water.Amount: the weight of the water added (= Water.After - Water.Before) (calculated)
  16. Water.Loss: the difference between Weight.Before for the current imaging and the Weight.After for the previous imaging (calculated unless calcWaterLoss is FALSE)
  17. Area: the Projected.Shoot.Area..pixels. divided by 1000 i.e. the sum of the 3 Shoot Area Views divides by 1000 (calculated)
  18. Area.SV: the mean of Area.SV1 and Area.SV2 divided by a 1000 (calculated)
  19. Area.TV: the Projected.Shoot.Area from Top View divided by 1000 (calculated)
  20. Area.SV1: the Projected.Shoot.Area from Side View 1
  21. Area.SV2: the Projected.Shoot.Area from Side View 2
  22. Image.Biomass: Area.SV x sqrt(Area.TV) (calculated)
  23. Max.Height: maximum of Max.Dist.Above.Horizon.Line.SV1 and Max.Dist.Above.Horizon.Line.SV2 (calculated)
  24. Max.Dist.Above.Horizon.Line.SV1: the Max.Dist.Above.Horizon.Line.SV1 converted to cm (calculated)
  25. Max.Dist.Above.Horizon.Line.SV2: the Max.Dist.Above.Horizon.Line.SV2 converted to cm (calculated)
  26. Density: Area divided by Max.Height (calculated)
  27. Volume: Convex.Hull.TV x Max.Height (calculated)
  28. Centre.Mass: mean of Centre of Mass SV1 and SV2 expressed in cm (calculated)
  29. Center.Of.Mass.Y.SV1: Centre of Mass from Side View 1
  30. Center.Of.Mass.Y.SV2: Centre of Mass from Side View 2
  31. Convex.Hull.SV: mean of Convex.Hull.Area.SV1 divided by 1000 (calculated)
  32. Convex.Hull.TV: Convex.Hull.Area.TV divided by 1000 (calculated)
  33. Convex.Hull.Area.TV: area of Top View Convex Hull
  34. Convex.Hull.Area.SV1: area of Side View 1 Convex Hull
  35. Convex.Hull.Area.SV2: area of Side View 2 Convex Hull
  36. Boundary.To.Area.Ratio.SV1
  37. Boundary.To.Area.Ratio.SV2
  38. Boundary.To.Area.Ratio.TV
  39. Compactness.SV1: Area.SV1 / Convex.Hull.Area.SV1 (calculated)
  40. Compactness.SV2 Area.SV2 / Convex.Hull.Area.SV2 (calculated)
  41. Compactness.SV: Area.SV / Convex.Hull.SV (calculated)
  42. Compactness.TV: Area.TV / Convex.Hull.TV (calculated)
  43. Caliper.Length.SV1
  44. Caliper.Length.SV2
  45. Caliper.Length.TV

Details

The columns are copied from data, except for those columns in the list under Value that have `(calculated)' appended.

Examples

Run this code
data(exampleData)
longi.prime.dat <- longitudinalPrime(data=raw.dat, smarthouse.lev=1)

Run the code above in your browser using DataLab