Data science Software Course Training in Ameerpet Hyderabad

Data science Software Course Training in Ameerpet Hyderabad

Thursday 30 March 2017

R and Analytics Basics 1

sankara.deva2016@gmail.com

Bharat sreeram, Ventech It Solutions
-----------------------------------------------------------


 ls()
--- list of of r objects.
rm("x")
-- removes object
-----------------------------------------
 a <- 100
 a = 100
 b = 200
 c = a + b
 d = a^3
 e = a**2
 name = "Giri"
  a%%2 ---> remainder.
----------------------------------
>  x = c (10,20,30,40,23,45,67,90)
> x[1] # first element
> length(x) # number of elements
> x[length(x)] # last element
> x[1:3] # first 3 elements
> x[4:length(x)] # 4th onwards
> x[9]=100 # adding 9 th element
> x[length(x)+1]=150 # adding element to last.
--------------------------------
> x
 [1]  10  20  30  40  23  45  67  90 100 150
> y = x + 10
> y
 [1]  20  30  40  50  33  55  77 100 110 160
>
 z = c(1,2,3,4,5)
 u = x + z
 # element to element arithmetic operation will happen.
  # if number of elements are different.
 iterations will happen till all elements of
 big vector is completed.
> sum(x)
[1] 575
> mean(x)
[1] 57.5
> length(x)
[1] 10
> max(x)
[1] 150
> min(x)
[1] 10
> var(x)
[1] 1953.389
> sd(x)
[1] 44.19716
>
-------------------------------------
gm = function(x){
  v = 1
  for (i in x){
     v = v * i
  }
  n = length(x)
  v^(1/n)
 }
# last expression will be returned.
------------------------------------
 hm = function(x) {
     xx = 1/x
     sxx = sum(xx)
     n = length(x)
     n/sxx
 }
--------------------------------
# function for variance of population
 vpop = function(x){
   xbar = mean(x)
   dev = x - xbar
   sumdsq = sum( dev^2)
    n = length(x)
    sumdsq/n
 }
 # function for standard deviation of Population.
 sdpop = function(x) {
    sqrt(vpop(x))
 }
--------------
 a = 1:10
 # generates auto sequence number,
   incremented by 1.
 b = 10:1
 c = seq(10,100,5)
 d = seq(100,10,-5)
-----------------------------------------

























----------------------------




.
   




1 comment:

  1. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Apache spark mlib, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on Apache spark mlib. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.

    For Free Demo Contact us:
    Name : Arunkumar U
    Email : arun@maxmunus.com
    Skype id: training_maxmunus
    Contact No.-+91-9738507310
    Company Website –http://www.maxmunus.com


    ReplyDelete