Home > Snippets of Code > Install R language in CentOs Linux

Install R language in CentOs Linux

Let’s see how to install R language in CentOs Linux. It is pretty simple:

Trying just that didn’t work…:

yum install R
No package R available.

And this one neither did:

yum install R-core R-devel
No pack…

# Install epel for El6 or CentOS 6
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install R

Ok. Now R is already intelled. Let’s check it out:

R

R version 3.0.2 (2013-09-25) — “Frisbee Sailing”
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type ‘license()’ or ‘licence()’ for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type ‘contributors()’ for more information and
‘citation()’ on how to cite R or R packages in publications.

Type ‘demo()’ for some demos, ‘help()’ for on-line help, or
‘help.start()’ for an HTML browser interface to help.
Type ‘q()’ to quit R.

> a=(1)
> a
[1] 1
> ls()
[1] “a”
> a
[1] 1
> b=(1:9)
> b
[1] 1 2 3 4 5 6 7 8 9
> a+b
[1] 2 3 4 5 6 7 8 9 10
> sum(a)
[1] 1
> sum(b)
[1] 45
> mean(b)
[1] 5
> var(b)
[1] 7.5
> b^2
[1] 1 4 9 16 25 36 49 64 81

 

It works!

Advertisements
Categories: Snippets of Code Tags: , , , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: