yarrr icon indicating copy to clipboard operation
yarrr copied to clipboard

Plotting in a loop

Open NicoBia90 opened this issue 5 years ago • 1 comments

Hello, I'm using a pirateplot inside a loop and I'd like to include the i-value in the title of the graph. How should I do it?

Thanks

NicoBia90 avatar Aug 07 '19 06:08 NicoBia90

Hi Nico, in this case, the paste() function is your friend.

For example, try..

library(yarrr)

for(i in 1:4) {
  
  pirateplot(weight ~ Time, data = ChickWeight, main = paste("plot", i))
  
}

ndphillips avatar Aug 08 '19 07:08 ndphillips