plot_loc: Plot animal locations subset with all as background

View source: R/2_plot.R

plot_locR Documentation

Plot animal locations subset with all as background

Description

Draw a scatter plot of some animals' location with ggplot2 (like plot 2 Overview in app). To add all animals as background, the full data set of animals is also needed.

Usage

plot_loc(loc_data_subset, loc_data = NULL, point_size = 0.1)

Arguments

loc_data_subset

A subset of animals. A data.table subset taken from full data set of all animals location loc_data. Note the id column is factor with all animals identity as levels. So this subset still have all identities information, which is needed to color each animal consistently.

loc_data

The full data set of all animals location in combined data.table format, usually came from combine(). If background is not needed, this parameter can be skipped and take the default NULL value. In this case better use named parameter for point_size if needed, like plot_loc(loc_data_subset, point_size = 0.2) instead of plot_loc(loc_data_subset, 0.2) otherwise the second parameter will be interpreted as loc_data.

point_size

The size of point in plot. Denser plot may need smaller point size.

Value

A ggplot object.


ctmm-initiative/ctmm-webapp documentation built on Aug. 21, 2023, 4:39 a.m.