DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Hello R Language Notes


Install

On Archlinux

$ sudo pacman -Syu r
$ yaourt -S rstudio-desktop-bin

Usage

In REPL

$ R
> ints = 1:100
> doubleInts = sapply(ints, function(x) 2*x)
> head(doubleInts)
[1] 2 4 6 8 10 12
> quit()

Run R Script

$ cat r-ex
ints = 1:100
doubleInts = sapply(ints, function(x) 2*x)
head(doubleInts)
$ Rscript r-ex
[1]  2  4  6  8 10 12

Run with RStudio

Start RStudio with rstudio-bin, then input commands like in normal REPL.



Published

Jul 16, 2014

Last Updated

Jul 16, 2014

Category

Tech

Tags

  • r-lang 1

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor