addSpatialCentroidLocationsLayer#

Last Updated: Jan 29, 2024

Description#

Calculates the centroid locations for the polygons within one selected layer

Usage#

addSpatialCentroidLocationsLayer(
  gobject,
  poly_info = "cell",
  feat_type = NULL,
  provenance = poly_info,
  spat_loc_name = "raw",
  init_metadata = TRUE,
  return_gobject = TRUE
)

Arguments#

gobject

giotto object

poly_info

polygon information

feat_type

feature type

provenance

(optional) provenance to assign to generated spatLocsObj. If not provided, provenance will default to poly_info

spat_loc_name

name to give to the created spatial locations

init_metadata

initialize cell and feature metadata for this spatial unit (default = TRUE, but should be turned off if generated earlier in the workflow)

return_gobject

return giotto object (default: TRUE)

Value#

If return_gobject = TRUE the giotto object containing the calculated polygon centroids will be returned. If return_gobject = FALSE only the generated polygon centroids will be returned as spatLocsObj.