lm_piecharts: Add a "piecharts" layer to a lifemap_obj object.

View source: R/lm_piecharts.R

lm_piechartsR Documentation

Add a "piecharts" layer to a lifemap_obj object.

Description

Add a "piecharts" layer to a lifemap_obj object.

Usage

lm_piecharts(
  data = NULL,
  param,
  type = c("pie", "bar", "polar-area", "polar-radius", "auto"),
  width = 30,
  height = 30,
  opacity = 1,
  showLabels = FALSE,
  pal = "Accent",
  legend = TRUE,
  legendPosition = c("topright", "bottomright", "bottomleft", "topleft"),
  display = c("auto", "requested", "all", "leaves")
)

Arguments

data

A sub dataset to use, if NULL then all of the taxids from the lifemap object given to lifemap() will be used.

param

A column name indicating the discret variable to be represented.

type

The type of chart to draw.

width

The maximal width of the charts.

height

The maximal height of the charts.

opacity

The chart's opacity.

showLabels

A boolean indicating whether to display the values directly on the chart or not.

pal

The palette to be used for the charts.

legend

A boolean indiacting whether to draw the legend or not.

legendPosition

c("topright", "bottomright", "bottomleft", "topleft"). Where should the legend be placed.

display

c("auto", "requested", "all", "leaves"), a string indicating how to display charts :

  • "auto" : the markers are displayed depending on the zoom level, by default, allow to have a lot of charts

  • "requested" : only displays the requested taxa, but all at the same time

  • "all" : displays all the taxa including all the ancestors to the root

  • "leaves" : displays only the latest (most recent) taxa

(WARNING : "requested", "leaves" and "auto" shouldn't be used to display more than 2000 charts as it may result in long computing time)

Value

An lm_piecharts object containing all aesthetics details for one layer of charts

Examples

data(LM_eukaryotes)

lm_piecharts(param = "Status")

lm_piecharts(data = LM_eukaryotes$df[LM_eukaryotes$df$Group %in% "Plants", ], param = "Status")


LifemapR documentation built on May 29, 2024, 5:05 a.m.