1

I'm using plotly to generate plots in my code and then using orca to save them as pdf files (for incorporating into my LaTeX report). It takes a bit of time to save the plots and I would like to do it all in one shot using a list and lapply.

I can manually add all the plots to a list and then use lapply but was wondering if there's a way to identify all plotly plots from ls(). Perhps, something similar to tables() from data.table?

ismirsehregal
  • 30,045
  • 5
  • 31
  • 78
Gautam
  • 2,597
  • 1
  • 28
  • 51
  • If you named them in some clever way like myPlot1 myPlot2 or fig1, fig2 etc you can use the `pattern` argument in `ls`. If not, you can pull all of the names, then run through them and extract those having the proper class. – lmo Jun 03 '19 at 12:39
  • 1
    @lmo you're right - I wasn't using `class` so much as `typeof`. Thanks! It works for me now. – Gautam Jun 03 '19 at 13:14

0 Answers0