designFactors: Adds the factors and covariates for a blocked, split-unit...

designFactorsR Documentation

Adds the factors and covariates for a blocked, split-unit design


Add the following factors and covariates to a date frame containing imaging data from the Plant Accelerator: Zone, xZone, SHZone, ZLane, ZMainunit, Subunit and xMainPosn. It checks that the numbers of levels of the factors are consistent with the observed numbers of carts and observations.


designFactors(data, insertName = NULL, designfactorMethod = "LanePosition", 
              nzones = 6, nlanesperzone = 4, 
              nmainunitsperlane = 11, nsubunitspermain = 2)



A data.frame to which are to be added the design factors and covariates and which must contain the following columns:

Smarthouse, Snapshot.ID.Tag, xDAP, and,

if designfactorMethod = "LanePosition", Lane and Position.


A character giving the name of the column in the data.frame after which the new factors and covariates are to be inserted. If NULL, they are added after the last column.


A character giving the method to use to obtain the columns for the design factors Zone, ZLane, Mainunit and Subunit. For LanePosition, it is assumed that (i) Lane can be divided into Zone and ZLane, each with nzones and nlanesperzone levels, respectively, and (ii) Position can be divided into Mainunit and Subunit, each with nmainunitsperlane and nmainunitsperlane levels, respectively. The factor SHZone is formed by combining Smarthouse and Zone and ZMainunit is formed by combining ZLane and Mainunit. For StandardOrder, the factors Zone, ZLane, Mainunit, Subunit are generated in standard order, with the levels of Subunit changing for every observation and the levels of subsequent changing only after all combinations of the levels of the factors to its right have been cycled through.


A numeric giving the number of zones in a smarthouse.


A numeric giving the number of lanes in each zone.


A numeric giving the number of mainunits in each lane.


A numeric giving the number of subunits in a main plot.


The factors Zone, ZLane, ZMainunit and Subunit are derived for each Smarthouse based on the values of nzones, nlanesperzone, nmainunitsperlane, nsubunitspermain, Zone being the blocks in the split-unit design. Thus, the number of carts in each Smarthouse must be the product of these values and the number of observations must be the product of the numbers of smarthouse, carts and imagings for each cart. If this is not the case, it may be able to be achieved by including in data rows for extra observations that have values for the Snapshot.ID.Tag, Smarthouse, Lane, Position and Time.after.Planting..d. and the remaining columns for these rows have missing values (NA) Then SHZone is formed by combining Smarthouse and Zone and the covariates cZone, cMainPosn and cPosn calculated. The covariate cZone is calculated from Zone and cMainPosn is formed from the mean of cPosn for each main plot.


A data.frame including the columns:

  1. Smarthouse: factor with levels for the Smarthouse

  2. Zone: factor dividing the Lanes into groups, usually of 4 lanes

  3. cZone: numeric corresponding to Zone, centred by subtracting the mean of the unique positions

  4. SHZone: factor for the combinations of Smarthouse and Zone

  5. ZLane: factor for the lanes within a Zone

  6. ZMainunit: factor for the main units within a Zone

  7. Subunit: factor for the subunits

  8. cMainPosn: numeric for the main-plot positions within a Lane, centred by subtracting the mean of the unique Positions

  9. cPosn: numeric for the Positions within a Lane, centred by subtracting the mean of the unique Positions


Chris Brien


longi.dat <- prepImageData(data = raw.dat, smarthouse.lev = 1)
longi.dat <- designFactors(data = longi.dat, insertName = "Reps",
                           nzones = 1, nlanesperzone = 1, nmainunitsperlane = 10, 

growthPheno documentation built on May 29, 2024, 6:03 a.m.