Learn R Programming

pcutils (version 0.2.8)

igraph_translator: Translate text of igraph

Description

Translate text of igraph

Usage

igraph_translator(
  ig,
  from = "en",
  to = "zh",
  which = c("vertex", "edge", "all")[1],
  verbose = TRUE
)

Value

igraph object

Arguments

ig

igraph object to be translated

from

source language

to

target language

which

vertex, edge, or all

verbose

verbose

Examples

Run this code
if (FALSE) {
library(igraph)
ig <- make_graph(c("happy", "sad", "sad", "angry", "sad", "worried"))
plot(ig)
ig2 <- igraph_translator(ig)
font_file <- "/System/Library/Fonts/Supplemental/Songti.ttc"
sysfonts::font_add("Songti", font_file)
plot(ig2, vertex.label.family = "Songti")
}

Run the code above in your browser using DataLab