running r scripts or commands with interpretor in unix for unix-layman

后端 未结 4 739
情话喂你
情话喂你 2020-12-28 20:18

I am layman to unix and sofar I using R in windows. For example I type following in my R session (in R gui).

# this is a my funny example script 
X <- 1:         


        
4条回答
  •  爱一瞬间的悲伤
    2020-12-28 21:12

    I'm guessing from the way you worded your question that you maybe SSH'ed into a linux machine? Or that you installed Ubuntu, for example, on your usual laptop/PC.

    Assuming it's the second case: open a terminal and type sudo apt-get install r-base. Then type R. Then type

    X <- 1:10
    Y <- 21:30
    plot(X, Y)
    myfun <- function (x){
                  x1 <- x^0.2
                  return (x1)
                 }
    myfun(X)
    

    Since your question is about unix versus linux rather than R, you might also try http://unix.stackexchange.com. There is a lot to be said about the differences between linux and unix, but all you probably need to know is: download Ubuntu, burn it onto a disc, then restart your computer with the disc in your CD drive.

    Hope this helps.

提交回复
热议问题