renderLinks: Create an html list of links.

View source: R/get_templates.R

renderLinksR Documentation

Description

Create an html list of links.

Usage

renderLinks(data, columns, labels = NULL, target = "_blank", sites = NULL)

Arguments

data

data frame which contains the data.

columns

column name which contains the urls.

labels

column name which contains the text to display.

target

The target attribute specifies where to open the linked document: '_blank' opens the linked document in a new window or tab; '_self' opens the linked document in the same frame as it was clicked; framename opens the linked document in the named iframe.

sites

A data frame of 3 columns (url, name, icon) with the sites that the function will recognize.

Value

a character vector of html formatted links.

Author(s)

Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/

Examples

links <- data.frame(name = c(
    "Camarhynchus psitticula",
    "Camarhynchus pauper",
    "Camarhynchus parvulus"
  ), wikipedia=c(
    "https://en.wikipedia.org/wiki/Large_tree_finch",
    "https://en.wikipedia.org/wiki/Medium_tree_finch",
    "https://en.wikipedia.org/wiki/Small_tree_finch"
  ),wikidata=c(
    "https://www.wikidata.org/wiki/Q578835",
    "https://www.wikidata.org/wiki/Q1125857",
    "https://www.wikidata.org/wiki/Q1086136"
  ))
html <- renderLinks(links,c("wikipedia","wikidata"))

Modesto-Escobar/netCoin-2.x documentation built on July 26, 2024, 11:15 p.m.