View source: R/make_transect_funs.R
make_transects | R Documentation |
For returning a specified number of transects perpendicular to a user supplied line feature. User options include the number of transects, the length of the transect (in meters), and the size (assumed to be a square) of each transect cell (in meters).
Set 'buddy_t' to TRUE to generate a transect less 3 transect sizes away but at least 1 transect size away so that sampling can be performed traveling away from the line feature and back to the line feature.
The direction specifies which direction from the line layer transects should be generated. Typically "positive" indicates transects to the North and West while "negative" generates transects to the South and East. Default is both directions from the line layer. Recommended to play with and decide for your needs.
While all overlaps are not guaranteed to be removed, setting 'allow_overlaps' to FALSE (default) will restrict sampling to where the risk is minimized. This is done by making a buffer the width of the transects around the line layer and removing sections of the line layer where the buffer overlaps.
Note, if the number of transects are smaller than the number of distinct line features then transects will be placed on random line features. If the number of transects is equal to the number of distinct line features then one transect will be placed on each line feature. If the number of transects is greater than the number of line features then at least one transect will be placed on each line feature and remaining transects will be distributed by the length of line features (e.g. longer line features have more transects).
make_transects(
line_layer_path,
poly_layer_path = NULL,
poly_strat_col = NULL,
t_number,
t_length,
t_size,
buddy_t = TRUE,
direction = c("positive", "negative"),
allow_overlaps = FALSE
)
line_layer_path |
Character, path to the .shp file of the line layer to build transects from. |
poly_layer_path |
Optional character, path to the .shp file of the polygon layer to stratify transects on. |
poly_strat_col |
TODO - Optional character, column name to use for stratifying. |
t_number |
Numeric, the approximate number of transects to generate. |
t_length |
Numeric, the desired length of transects (in meters). |
t_size |
Numeric, the size (Y x Y) of the transect cells (in meters). |
buddy_t |
Logical, default is TRUE, whether to include a buddy transect for efficient sampling. |
direction |
Character, default is c("positive", "negative"), the direction from the line layer transects should be built. |
allow_overlaps |
Logical, default is FALSE, whether to remove areas of line where transects could overlap with other transects. |
A 'sf' object with transect lines and ID numbers in lat long.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.