plot_region_wordcloud: plot_region_wordcloud

Description Usage Arguments Value Examples

View source: R/plot_region_wordcloud.R

Description

Plot a wordcloud in the shape of a region.

Usage

1
2
3
4
5
6
7
8
plot_region_wordcloud(
  dataframe,
  mask,
  name_column_words,
  name_column_frequency,
  max_word_size = 4,
  rm_outside = TRUE
)

Arguments

dataframe

The dataframe containing the input data for a single region.

mask

The path to a png image of the region to be used as the shape of the wordcloud. Can be retreived by using 'plot_region_mask()'.

name_column_words

The name of the column in 'dataframe' containing the words.

name_column_frequency

The name of the column in 'dataframe' containing the frequencies.

max_word_size

The maximum size of the words in the wordcloud. At the minimum value '1' all the words are equally sized. Default is '4'.

rm_outside

Whether to remove words that could not be fitted in the wordcloud area. If set to 'FALSE', these words will be stacked on top of each other at the centre of each region. Default is 'TRUE'.

Value

A ggplot object with a randomly coloured wordcloud in the shape of the region ind 'dataframe'.

Examples

1
2
3
4
5
## Not run: 
companies_region <- data("companies_DEU") %>% filter(code == "DE2")
plot_region_wordcloud(companies_region, "./mask.png", companies_region[["name"]], companies_region[["employees"]])

## End(Not run)

GabZech/wordcloud.mappeR documentation built on Dec. 23, 2021, 11:11 p.m.