This is driving me crazy, mostly because I've done it before and can't find the code for it.
Let's say I have the following dataframe:
df <- tibble(
TIME = 0:19,
VAL1 = seq(from = 10, to = 2500, length.out = 20),
VAL2 = seq(from = 1, to = 30, length.out = 20))
I'd like VAL1, which has a large range, to be plotted on the left y-axis using a log scale, and VAL2, which has a much smaller range, to be plotted on the right y-axis using a linear scale.
I know there are other examples out there (see here and here), but I can't seem to get the y-axes to line up correctly using those approaches.
Any thoughts?