Using the Base R pipe to scale a column for a melted dataframe without modifying theoriginal dataframe
Minimal reproducible example:
I have a dataframe df
with 3 columns, x, y,
and z
. I want to plot x
and y
by melting the first two columns of df
and passing the melted dataframe to ggplot
. I want to scale x
by 10 to plot it on a secondary axis. Currently I do the following: