Learn R Programming

ggblanket (version 1.5.0)

add_tooltip_text: Add a tooltip text column.

Description

Add a tooltip text column of united variable names and values.

Usage

add_tooltip_text(data, ..., titles = NULL)

Value

A data frame or tibble with a column of text

Arguments

data

A data frame or tibble.

...

Arguments passed to select (i.e unquoted variables, tidyselect helpers etc). If no arguments provided, uses all columns.

titles

A function to format the variable names, including in rlang lambda format.

Examples

Run this code
iris %>%
  add_tooltip_text() %>%
  head(1)

 iris %>%
  add_tooltip_text(Species, tidyselect::contains("Sepal")) %>%
  head(1)

  library(snakecase)

 iris %>%
  add_tooltip_text(titles = ~ to_sentence_case(.x)) %>%
  head(1)

 iris %>%
   add_tooltip_text() %>%
   gg_point(x = Sepal.Width,
            y = Sepal.Length,
            col = Species,
            text = text,
            theme = gg_theme(text_family = "helvetica")) %>%
    plotly::ggplotly(tooltip = "text")

Run the code above in your browser using DataLab