cog_href: Href Cognostic

View source: R/cog.R

cog_hrefR Documentation

Href Cognostic

Description

Create href to be used as cognostics in a trelliscope display

Usage

cog_href(
  x,
  desc = "link",
  group = "common",
  type = c("href", "href_hash"),
  default_label = FALSE,
  default_active = FALSE,
  filterable = FALSE,
  sortable = FALSE,
  log = FALSE
)

Arguments

x

URL to link to

desc, group, default_label, default_active, filterable, sortable, log

arguments passed to cog

type

of either "href" or "href_hash". "href" will open the link in a new page. "href_hash" will update the page's hash and reload the page (useful when changing state inside an iframe)

See Also

cog

Examples


library(dplyr)
library(tidyr)
library(plotly)
iris %>%
  nest(data = -Species) %>%
  mutate(
    panel = map_plot(data, function(x) {
      plot_ly(data = x, x = ~Sepal.Length, y = ~Sepal.Width,
        type = "scatter", mode = "markers")
    }),
    wiki_link = cog_href(paste0("https://en.wikipedia.org/wiki/Iris_",
      tolower(Species))[1], default_label = TRUE,
      desc = "link to species on wikipedia")
  ) %>%
  trelliscope(name = "iris_species", ncol = 3)


trelliscopejs documentation built on Aug. 8, 2025, 6:40 p.m.