Multiple plots with high-level plotting functions, especially plot.rqs()

前端 未结 2 1278
借酒劲吻你
借酒劲吻你 2021-01-20 02:09

I am trying to plot two regression summaries side-by-side with one centered title. Each regression summary is generated by plot.rqs() and amounts to a set of 9

2条回答
  •  情话喂你
    2021-01-20 02:56

    You can patch a function as follows: use dput and capture.output to retrieve the code of the function, as a string; change it as you want (here, I just replace each occurrence of par with a function that does nothing); finally evaluate the result to produce a new function.

    library(quantreg)
    a <- capture.output(dput(plot.summary.rqs))
    b <- gsub("^\\s*par\\(", "nop(", a)
    nop <- function(...) {}
    my.plot.summary.rqs <- eval(parse(text=b))
    

提交回复
热议问题