spiderplot_data: Translate paternity output into segments for geom_segments

View source: R/spiderplot_data.R

spiderplot_dataR Documentation

Translate paternity output into segments for geom_segments

Description

This is a convienence function that takes the output of a paternity() function and the raw data.frame with the coordinates and turns it into a data.frame that can be used in geom_segments.

Usage

spiderplot_data(
  pat,
  df,
  ID = "ID",
  OffID = "OffID",
  longitude = "Longitude",
  latitude = "Latitude"
)

Arguments

pat

The output from the paterntiy() function.

df

A data.frame with columns for the ID of the fathers and spatial coordinates.

ID

The name of the column in df that has the ID of the fathers (default="ID")

OffID

The column name in df that has the offspring id value

longitude

The label for the x-coordinate for the adults as it is found in the df object (default="Longitude")

latitude

The label for the y-coordinate for the adults as it is found in the df object (default="Latitude")

Value

A data.frame with the segments correctly formated for geom_segment.

Author(s)

Rodney J. Dyer <rjdyer@vcu.edu>


dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.