Need Help with Nested Loop for simulation

Hello Guys,

I have a data frame with three columns x, y , z. I want to plot line chart with x on x axis and y and z on y axis. Also, y and z are different scale, which are not multiple of each other. I want to plot z on a secondary axis with scale correspoding to range of z. PLease help me how can I do that with an example.


See the FAQ: How to do a minimal reproducible example reprex for beginners.