plot_dual_axis: Two series on a left and a right axis

View source: R/plot.R

plot_dual_axisR Documentation

Two series on a left and a right axis

Description

Two series on a left and a right axis

Usage

plot_dual_axis(data, x, left, right, log_right = FALSE, title = NULL)

Arguments

data

Data frame with the three columns

x

Column for the horizontal axis, for example date

left

Column for the left axis

right

Column for the right axis

log_right

Show log(1 + right) on the right axis

title

Plot title

Value

ggplot object

Examples


df <- data.frame(month = 1:24, rain = abs(sin(1:24 / 2)) * 300, searches = abs(sin(1:24 / 2)) * 80)
plot_dual_axis(df, "month", "rain", "searches")


varunayan documentation built on Oct. 30, 2026, 1:07 a.m.