Skip to contents

Delineate blocks on a trial design and assign block id to all the plots

Usage

add_blocks(td)

Arguments

td

trial design made by applying assign_rates() to experimental plots made by make_exp_plots()

Value

trial design with block_id added

Examples

#--- load rate information ---#
data(td_single_input)

#--- add blocks ---#
td_with_blocks <- add_blocks(td_single_input)

#--- take a look ---#
td_with_blocks$trial_design
#> [[1]]
#> Simple feature collection with 191 features and 6 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -16.70078 ymin: 39.11957 xmax: -16.69604 ymax: 39.12696
#> Geodetic CRS:  WGS 84
#> First 10 features:
#>    rate strip_id plot_id       type block_id plot_id_within_block
#> 1    10        1       1 experiment        1                    1
#> 2    20        1       2 experiment        1                    2
#> 3    30        1       3 experiment        1                    3
#> 4    40        1       4 experiment        1                    4
#> 5    50        1       5 experiment        1                    5
#> 6    10        1       6 experiment        2                    1
#> 7    20        1       7 experiment        2                    2
#> 8    30        1       8 experiment        2                    3
#> 9    40        1       9 experiment        2                    4
#> 10   50        1      10 experiment        2                    5
#>                          geometry
#> 1  POLYGON ((-16.70021 39.1196...
#> 2  POLYGON ((-16.70021 39.1203...
#> 3  POLYGON ((-16.70021 39.1210...
#> 4  POLYGON ((-16.70021 39.1217...
#> 5  POLYGON ((-16.70021 39.1224...
#> 6  POLYGON ((-16.70021 39.1231...
#> 7  POLYGON ((-16.70021 39.1238...
#> 8  POLYGON ((-16.70021 39.1245...
#> 9  POLYGON ((-16.70021 39.1252...
#> 10 POLYGON ((-16.70021 39.126,...
#> 

#--- visualize ---#
viz(td_with_blocks, type = "block_id")
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_text()`).