Guest User

Untitled

a guest
Nov 14th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #abbreviation
  2. s = summary
  3.  
  4.  
  5. # Make + for strings
  6. "+" <-function(x, y=0){
  7. if (is.character(x)){
  8. paste(as.character(x),as.character(y), sep="")
  9. } else{
  10. base::"+"(x,y)
  11. }
  12. }
  13.  
  14. #text evaluation
  15. eval_text = function(text)eval(parse(text=text))
  16.  
  17. #install packages if not
  18. library <- function(package){
  19. package=deparse(substitute(package))
  20. if(!(package %in% installed.packages())) #if not installed yet.
  21. install.packages(package)
  22. eval_text("base::library("+package+")")
  23. }
  24.  
  25.  
  26. library(dplyr)
Add Comment
Please, Sign In to add comment