Learn R Programming

ForestElementsR (version 2.2.0)

get_center: Obtaining Center Coordinates of Spatial fe_stand Child Objects

Description

Obtaining Center Coordinates of Spatial fe_stand Child Objects

Usage

get_center(x)

Value

The coordinates of the point that describes best the spatial center of the object x. In case of objects of classes fe_ccircle_spatial, and fe_ccircle_spatial_notrees, this is the center of the concentric circle with the largest area. In case of an fe_stand_spatial object, this is the center of gravity of the object's polygon outline. The point object returned belongs to a class provided by the package sf. The class of that object depends on how the coordinates are defined in x (i.e. as an sfc or an sfg object). If x is unsuitable for retrieving center coordinates, the function returns an empty geometry.

Arguments

x

An object of one of fe_stand's child classes that carry spatial information, i.e. fe_stand_spatial, fe_ccircle_spatial, fe_ccircle_spatial_notrees

Examples

Run this code
  spruce_pine_ccircle_spatial_notrees |> get_center()
  spruce_pine_ccircle_spatial_notrees |> get_center()
  mm_forest_1_fe_stand_spatial |> get_center()

  # Unsuitable objects
  get_center(spruce_beech_1_fe_stand)
  get_center("this is a character string")

Run the code above in your browser using DataLab