attribute_sectors: Determine sectors for each point based on trigonometry

View source: R/attribute_sectors.R

attribute_sectorsR Documentation

Determine sectors for each point based on trigonometry

Description

A full circle is 2*pi, the sector of each point is determined by atan2(y,x), the angle of the point relative to the horizontal line of the introduction site

Usage

attribute_sectors(
  dataset,
  nb_sectors = 8,
  centroid = c(-75.67534, 40.41524),
  rotation = 1
)

Arguments

dataset

A dataset to be processed

nb_sectors

Number of sectors to divide the invasion space (default: 8)

centroid

Coordinates of the centroid to center the circle (long, lat; default: -75.675340, 40.415240)

rotation

Number of rotations of the grid wanted (default: 1)

Value

The same table as dataset multiplied by the number of rotations, with additional columns: sectors containing the total number of sectors considered, rotation_nb containing the rotation considered, sectors_nb containing the sector number attributed to this cell in this rotation

Examples

new_dataset <- attribute_sectors(dataset)

nbelouard/slfjumps documentation built on July 27, 2024, 8:28 a.m.