Learn R Programming

netCoin (version 2.1.0)

renderLinks: Create an html list of links.

Description

Create an html list of links.

Usage

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

Value

a character vector of html formatted links.

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.

Author

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

Examples

Run this code
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"))

Run the code above in your browser using DataLab