cogHref: Href Cognostic

Description Usage Arguments See Also Examples

View source: R/cognostics.R

Description

Create href to be used as cognostics in a trelliscope display.

Usage

1
2
3
cogHref(x, label = "link", desc = "link", group = "common",
  target = "_blank", defLabel = FALSE, defActive = FALSE,
  filterable = FALSE, sortable = TRUE, log = FALSE)

Arguments

x

URL to link to

label

label of the href

desc, group, defLabel, defActive, filterable, sortable, log

arguments passed to cog

target

value to be used for the target attribute of the a html tag - default is "_blank" which will open the link in a new window

See Also

cog

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
d <- divide(iris, by = "Species")

# cognostics function that links to wikipedia
cogFn <- function(x) {
  link <- paste0("https://en.wikipedia.org/wiki/Iris_", getSplitVar(x, "Species"))
  list(wiki = cogHref(link, desc = "Look up species on wikipedia", defLabel = TRUE))
}

# test the cognostics function on a subset
applyCogFn(cogFn, d[[1]])

# make a display with this cognostics function
vdbConn(tempfile(), autoYes = TRUE)
makeDisplay(d, name = "iris_sl_sw",
  cogFn = cogFn, panelFn = function(x)
    lattice::xyplot(Sepal.Length ~ Sepal.Width, data = x))

## Not run: 
# clicking the link under each panel will open wikipedia
view(name = "iris_sl_sw")

## End(Not run)

delta-rho/trelliscope documentation built on May 12, 2017, 10:49 p.m.