align: Data alignment

Description Usage Arguments Details Value Examples

View source: R/align.R

Description

Provides a re-aligned is.raptor file, where new x- and y-coordinates (XCAL and YCAL values, respectively) are calculated according to a specified rotation. Appropriate alignment is achieved when the first row of earlywood cells are positioned along an approximately horizontal axis and the radial files of tracheids are positioned along a vertical axis.

Usage

1
align(input, year = FALSE, list = FALSE, interact = TRUE, make.plot = TRUE)

Arguments

input

an is.raptor file.

year

a numeric vector specifying the year of interest. The default (FALSE) applies the function on all years present in the input.

list

a vector of numeric values indicating the rotation slope for each year.

interact

a logical flag. If TRUE, the user can manually assign the degree of rotation for each annual ring in an interactive session. The user will have to select among the options (along the horizontal axis, along the vertical axis, manually define the degree of reorientation based on a set of slopes overlaid on the plot). If FALSE, the rotation is optimized automatically using a simple linear regression through all points along the horizontal axis (default = FALSE).

make.plot

logical flag indicating whether to make a plot (default = FALSE).

Details

Correct alignment of cells/tracheids is important for detecting the first cells and assigning cells to a radial file. This function provides the option to align your cell data (XCAL and YCAL). This function provides and interactive procedure to improve the alignment by presenting a crosshair with slopes with which the sample should be rotated. Proper alignment is obtain when the first cells are approximately aligned on a horizontal line and the upward cells are propagated vertically. Either interactively or with predefined slopes, the user can rotate the sample orientation. An automatic option is also available where a simple linear regression is fitted through all points to adjust the rotation. The plot shows the original position of the cells (black dots) and lines that can be selected to rotate the sample. After correction the new position of the cells is presented (red dots).

Value

An aligned is.raptor file.

Examples

1
2
3
#rotating example data
input<-is.raptor(example.data(species="LOT_PICEA"), str=FALSE)
input<-align(input, year=2007, list=FALSE,interact=FALSE, make.plot=TRUE)

the-Hull/raptor documentation built on Nov. 29, 2020, 10:20 p.m.