issues of wrapping up a set of workable R commands into a function

后端 未结 1 640
说谎
说谎 2021-01-24 01:49

I generate a dendrogam using a collection of r commands. It worked just fine and saved the generated dendromgram into a PDF file. To improve efficiency, I wrapped these commands

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-24 02:47

    R FAQ

    Wrap your ggplot call in a print() function.

    ggplot and friends return an object, and the plotting only happens when the object is printed. When you do this on the command line the printing happens automatically. When you stick it in a script or function you have to do it yourself.

    The debate on whether this is a good idea or a dumb thing that just generates questions like this continues...

    0 讨论(0)
提交回复
热议问题