Add the following factor
s 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 factor
s are consistent with the observed numbers of individuals and measurements taken of them.
designFactors(data, insertName = NULL, designfactorMethod = "LanePosition",
nzones = 6, nlanesperzone = 4,
nmainunitsperlane = 11, nsubunitspermain = 2)
A data.frame
including the columns:
Smarthouse: factor
with levels for the Smarthouse
Zone: factor
dividing the Lanes into groups, usually of 4 lanes
cZone: numeric corresponding to Zone, centred by subtracting the mean of the unique positions
SHZone: factor
for the combinations of Smarthouse and Zone
ZLane: factor
for the lanes within a Zone
ZMainunit: factor
for the main units within a Zone
Subunit: factor
for the subunits
cMainPosn: numeric for the main-plot positions within a Lane, centred by subtracting the mean of the unique Positions
cPosn: numeric for the Positions within a Lane, centred by subtracting the mean of the unique Positions
A data.frame
to which are to be added the design
factor
s 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 factor
s
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 factor
s 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 factor
s 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 factor
s 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.
Chris Brien
The factor
s 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 individuals in each Smarthouse must be the product of these values and the number of observations must be the product of the numbers of smarthouse, indviduals and imagings for each individual. 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.
data(exampleData)
longi.dat <- prepImageData(data = raw.dat, smarthouse.lev = 1)
longi.dat <- designFactors(data = longi.dat, insertName = "Reps",
nzones = 1, nlanesperzone = 1, nmainunitsperlane = 10,
designfactorMethod="StandardOrder")
Run the code above in your browser using DataLab