Author: Feng Li

  • Common R traps

    I will show some R traps here.  The purpose of this page is not going to tell you how “crappy” R is. R is great indeed and also these kind of “traps” can happen in any other languages. if(a<-5) Assume you want make a condition to check if “a is smaller than negative five“, then…

  • Command line clear R console screen

    Under Linux console, you can always clear the R screen by command line cat(“\033[2J\033[H”) Note: This is not applicable to Rgui for Windows.

  • Add comments on your R objects

    It is always good to add comments on your R code. But it is also good to add comments on your objects like variables, functions, etc. > Mydata comment(Mydata) <- “This is a data from a sequence” > Mydata [1] 1 2 3 4 5 6 7 8 9 10 > comment(Mydata) [1] “This is…