Add column subquadrat based on QX and QY coordinates.

add_subquad(data, x_q, y_q = x_q, x_sq, y_sq = x_sq, subquad_offset = NULL)

Arguments

data

A dataframe with quadrat coordinates QX and QY (e.g. a ViewFullTable).

x_q, y_q

Size in meters of a quadrat's side. For ForestGEO sites, a common value is 20.

x_sq, y_sq

Size in meters of a subquadrat's side. For ForestGEO sites, a common value is 5.

subquad_offset

Either -1 or 1, to rest or add one unit to the digit of each subquadrat that represents the column number.

First column is 0    First column is 1
-----------------    -----------------
   04 14 24 34          14 24 34 44
   03 13 23 33          13 23 33 43
   02 12 22 32          12 22 32 42
   01 11 21 31          11 21 31 41

Value

Returns data with the additional variable subquadrat.

See also

Other functions to add columns to dataframes: add_status_tree(), add_var()

Other functions for ForestGEO data: add_status_tree(), add_var()

Other functions for fgeo vft: add_status_tree(), add_var(), guess_plotdim(), pick_drop

Author

Anudeep Singh and Mauro Lepore.

Examples

# styler: off
vft <- tribble(
   ~QX,  ~QY,
  17.9,    0,
   4.1,   15,
   6.1, 17.3,
   3.8,  5.9,
   4.5, 12.4,
   4.9,  9.3,
   9.8,  3.2,
  18.6,  1.1,
  17.3,  4.1,
   1.5, 16.3
)
# styler: on

add_subquad(vft, 20, 20, 5, 5)
#> # A tibble: 10 × 3
#>       QX    QY subquadrat
#>    <dbl> <dbl> <chr>     
#>  1  17.9   0   41        
#>  2   4.1  15   14        
#>  3   6.1  17.3 24        
#>  4   3.8   5.9 12        
#>  5   4.5  12.4 13        
#>  6   4.9   9.3 12        
#>  7   9.8   3.2 21        
#>  8  18.6   1.1 41        
#>  9  17.3   4.1 41        
#> 10   1.5  16.3 14        

add_subquad(vft, 20, 20, 5, 5, subquad_offset = -1)
#> # A tibble: 10 × 3
#>       QX    QY subquadrat
#>    <dbl> <dbl> <chr>     
#>  1  17.9   0   31        
#>  2   4.1  15   04        
#>  3   6.1  17.3 14        
#>  4   3.8   5.9 02        
#>  5   4.5  12.4 03        
#>  6   4.9   9.3 02        
#>  7   9.8   3.2 11        
#>  8  18.6   1.1 31        
#>  9  17.3   4.1 31        
#> 10   1.5  16.3 04