Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. tesing
  2. =======================
  3.  
  4. ```{r echo=FALSE,results='asis'}
  5. mytest <- function(myresponse, myterms, mydata) {
  6. # do clever stuff...
  7. # then:
  8. plot1 <- barplot(ppr$pain_protocol1, name=ppr$category,las=2)
  9. plot2 <- barplot(ppr_pa$extra_pp, name=ppr_pa$adult_anaesthetist,las=2)
  10. list(plot1 = plot1, plot2 = plot2)
  11. }
  12.  
  13. terms <- c(' age', 'log_age', 'age2', 'inv_age', 'op_time', 'log_op_time',
  14. 'op_time2', 'gender', 'category', 'thimble')
  15. response <- 'pain_protocol1'
  16. results <- mytest(response, terms, d4)
  17.  
  18. ```
  19.  
  20. This is plot 1:
  21.  
  22. ```{r echo=FALSE,results='asis'}
  23. library(ggplot2)
  24. ggplot_build(results[["plot1"]])
  25. ```
  26.  
  27. This is plot 2:
  28.  
  29. ```{r echo=FALSE,results='asis'}
  30. results[["plot2"]]
  31. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement