To add to @rensa's answer, you can have a second y axis, but it has to be a one-to-one transformation of the first y axis. Below is an example using your data. The general idea is to decide on the transformation for the second axis and then, as rensa noted, multiply the data to be plotted on the secondary axis by the inverse transformation, so that the secondary axis ticks will correspond to the data values.
In this case, the desired transformation is linear. I've provided two potential transformations. The first one, which is commented out, sets the transformation so as to make the the two lines have the same maximum absolute value. The second one, which is actually used below, sets the transformation to a factor of 1,000. This results in the axis ticks for the secondary axis coinciding with those of the primary axis. The code below also sets the axis colors to be the same as the colors of the data lines to which the axis corresponds.
# Set color palette
cols = hcl(c(15, 15+180), 100, 65)
# Set scale factor for second axis
#scl = with(figure_1_sample, max(abs(REPPAY))/max(abs(REPP)))
scl = 1000
ggplot(figure_1_sample, aes(x = Year)) +
geom_line(aes(y = REPPAY, colour = "REPPAY")) +
geom_line(aes(y = REPP*scl, colour = "REPP")) +
scale_y_continuous(sec.axis = sec_axis(~./scl, name = "Repurchase permium"))+
ggtitle("Graph A: Number of repurchaser and repurchase premium ") +
theme(legend.position = "bottom",
legend.margin=margin(-5,0,0,0),
plot.title = element_text(hjust = 0.5),
axis.text.y.right=element_text(colour=cols[1]),
axis.ticks.y.right=element_line(colour=cols[1]),
axis.title.y.right=element_text(colour=cols[1]),
axis.text.y=element_text(colour=cols[2]),
axis.ticks.y=element_line(colour=cols[2]),
axis.title.y=element_text(colour=cols[2])) +
scale_colour_manual(values=cols) +
labs(colour="")
