save_wcloud2: Saving wordcloud2 object as png

View source: R/plot_wrdcloud.R

save_wcloud2R Documentation

Saving wordcloud2 object as png

Description

Saving wordcloud2 object as png

Usage

save_wcloud2(graphfile, filename)

Arguments

graphfile

wordcloud2 object

filename

name for saved file

Value

png files

Examples

## Not run: 
library(dataplot)
library(tidytext)
library(tidyr)
library(dplyr)

teks <- dataplot::datatwit
teks <- teks %>%
  unnest_tokens(kata, full_text_norm, token = "ngrams", n = 1) %>%
  count(kata, sort = TRUE) %>%
  head(n = 150)

my_graph <- wordcloud2(teks,
                       size = 2.3,
                       minRotation = -pi/0,
                       maxRotation = -pi/0,
                       rotateRatio = 1,
                       color = "grey",
                       fontFamily = "Roboto")

save_wcloud2(graphfile = my_graph, filename = "coba.png")

## End(Not run)

eppofahmi/dataplot documentation built on Jan. 22, 2025, 1:14 a.m.