get_radius_gyration: Calculate Radius of Gyration

View source: R/helper_functions.R

get_radius_gyrationR Documentation

Calculate Radius of Gyration

Description

Calculate Radius of Gyration

Usage

get_radius_gyration(
  DF,
  Latitude_Name = "Trip_End_Latitude",
  Longitude_Name = "Trip_End_Longitude"
)

Arguments

DF

The dataframe that contains all trips that you want to calculate the radius of gyration for

Latitude_Name

Character string of the column name in DF that has the trip end latitude location

Longitude_Name

Character string of the column name in DF that has the trip end longitude location

Value

Rg a single numeric value that gives the radius of gyration for the supplied dataframe in kilometers

Author(s)

Julie Wisch

References

https://blog.jlevente.com/radius-of-gyration/ https://alzres.biomedcentral.com/articles/10.1186/s13195-021-00852-1

Examples

## Not run: 
DF <- data.frame(
  "MapID" = c(68771, 68771, 69876),
  "Trip_End_Latitude" = c(38.88768, 38.606689, 40.23523),
  "Trip_End_Longitude" = c(99.6986, 97.76478, 98.56789)
)
get_radius_gyration(
  DF[DF$MapID == 68771, ],
  "Trip_End_Latitude",
  "Trip_End_Longitude"
)

## End(Not run)


RoeLabWustl/roelabr documentation built on Aug. 27, 2022, 9:57 a.m.