Feeds:
Posts
Comments

Archive for April, 2011

R tips

  • data=read.table(“file.dat”,header=true,sep=”,”)
    file.dat is
    A,B,C
    1,2,3
    4,5,6
    7,8,9
    data$A refers the column named “A”,…
    read.csv(“file.csv”) reads csv file.
  • data1 <- edit(data) : edit your data in a UI. It’s pretty cool.
  • par(mfrow=c(3, 2)) : show 2X3 canvas. The succeeding painting function will fill up the canvas.
  • plot(data$A): plot points (1,data$A[1]), (2,data$A[2]) …
  • plot(data$A,data$B): plot points (data$A[1],data$B[1]),…
  • hist(data$A): histogram of data$A
Advertisements

Read Full Post »