Learn R Programming

FIELDimageR (version 0.3.1)

fieldShape: Building the plot fieldshape file

Description

The user should select the four experimental field corners and the shape file with plots will be automatcly built using a grid with the number of ranges and rows. Attention: The base of image should be parallel to axis X, please use first the function fieldRotate.

Usage

fieldShape(
  mosaic,
  ncols = 10,
  nrows = 10,
  nPoint = 4,
  fieldMap = NULL,
  fieldData = NULL,
  ID = NULL,
  theta = NULL,
  plot = TRUE,
  fast.plot = FALSE
)

Arguments

mosaic

object of class stack obtained from function fieldRotate with the base of image parallel to axis X.

ncols

number of ranges.

nrows

number of rows.

nPoint

number of points necessary to select field boundaries or area to remove (4 >= nPoint <= 50).

fieldMap

matrix with plots ID identified by rows and ranges, please use first the funsction fieldMap.

fieldData

data frame with plot ID and all attributes of each plot (Traits as columns and genotypes as rows).

ID

name of plot ID in the fieldData file to combine with fieldShape.

theta

angle of rotation used on function fieldRotate. It is an important step to fit the fieldShape on the original image.

plot

if is TRUE the crop image and fieldShape will be plotted.

fast.plot

if TRUE only the grey scale image will be plotted as reference (faster approach).

Value

A list with two element

  • mosaic new mosaic cropped with the drew fieldshape.

  • fieldShape The function returns the fieldShape format SpatialPolygonsDataFrame with plots numbered from left to right and top to bottom, and a new reduced image with format stack. The fieldMap can be used to identify the plot ID.

Details

fieldShape