ggnewsPlot: Replicates DN's RevPAR figure in ggplot2

Description Usage Arguments Details Value Examples

View source: R/plot.R

Description

The function generates a figure often used by Dagens Næringsliv (DN), a Norwegian newspaper specializing in business news, to present data on RevPAR and changes in RevPAR for diferent regions/cities.

Usage

1
2
ggnewsPlot(df, outputReady = FALSE, customFont = FALSE,
  header = c("City", "RevPAR", "Change from same period last year"))

Arguments

df

input data.frame containg place, revpar and change in decimals.

outputReady

Logical. If TRUE, uses device size and is better suited for ouputs. Default is FALSE - fixed aspect ration.

customFont

Logical. If TRUE, use the font family Montserrat (if available). Default is 'sans'

header

Vector. Set header above columns. Takes a vector of length 3 with strings.

Details

This function is early development. Expect revisions.

Value

ggplot object

Examples

1
2
3
4
5
exampleFrame <- data.frame(Sted = c("Tromsø", "Stanvager", "Bodø", "Trondheim", "Bergen", "Lillehammer", "Gardermoen", "Haugesund", "Kristiansund", "Oslo", "Kristiansand"),
                           RevPAR = c(925, 432, 605, 526, 391, 463, 601, 367, 370, 613, 335),
                           Endring = c(0.153, 0.137, 0.036, 0.014, 0.008, -0.005, -0.029, -0.054, -0.074, -0.082, -0.179))

ggnewsPlot(exampleFrame)

mariuslarsson/touRism documentation built on Oct. 3, 2021, 8:30 p.m.