SlideShare une entreprise Scribd logo
1  sur  60
r-squared
Slide 1 www.r-squared.in/rprogramming
R Programming
Learn the fundamentals of data analysis with R.
r-squared
Slide 2
Course Modules
www.r-squared.in/rprogramming
✓ Introduction
✓ Elementary Programming
✓ Working With Data
✓ Selection Statements
✓ Loops
✓ Functions
✓ Debugging
✓ Unit Testing
r-squared
Slide 3
Working With Data
www.r-squared.in/rprogramming
✓ Data Types
✓ Data Structures
✓ Data Creation
✓ Data Info
✓ Data Subsetting
✓ Comparing R Objects
✓ Importing Data
✓ Exporting Data
✓ Data Transformation
✓ Numeric Functions
✓ String Functions
✓ Mathematical Functions
r-squared
Slide 4
Data Transformation
www.r-squared.in/rprogramming
In this section, we will explore built-in R function that can be used for
transforming/reshaping data. This section is further divided into 4 sub-sections:
● Reorder Data
● Subset/Filter Data
● Combine Data
● Transform Data
r-squared
Slide 5
Reorder Data
www.r-squared.in/rprogramming
In the course of analyzing data, sometimes it is necessary to reorder the data as we
cannot use the data in its original format. Sorting the data is the best example of such
reordering. In this section, we will learn the following functions:
✓ t (transpose)
✓ order
✓ sort
✓ rank
r-squared
Slide 6
t()
www.r-squared.in/rprogramming
Description:
t() returns the transpose of a matrix or data frame.
Syntax:
t(matrix/data frame)
Returns:
The transpose of the matrix or data frame.
Documentation
help(t)
r-squared
Slide 7
t()
www.r-squared.in/rprogramming
Examples
> # example 1
> m <- matrix(1:6, nrow = 2)
> dim(m)
[1] 2 3
> dim(t(m))
[1] 3 2
> m # 2 x 3 matrix
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
> t(m) # t() returns a 3 x 2 matrix
[,1] [,2]
[1,] 1 2
[2,] 3 4
[3,] 5 6
r-squared
Slide 8
t()
www.r-squared.in/rprogramming
Examples
> # example 2
> data <- mtcars
> head(data)
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1
> data_transpose <- t(data)
> head(data_transpose)
Mazda RX4 Mazda RX4 Wag Datsun 710 Hornet 4 Drive Hornet Sportabout Valiant
mpg 21.00 21.000 22.80 21.400 18.70 18.10
cyl 6.00 6.000 4.00 6.000 8.00 6.00
disp 160.00 160.000 108.00 258.000 360.00 225.00
hp 110.00 110.000 93.00 110.000 175.00 105.00
drat 3.90 3.900 3.85 3.080 3.15 2.76
wt 2.62 2.875 2.32 3.215 3.44 3.46
r-squared
Slide 9
order()
www.r-squared.in/rprogramming
Description:
order() sorts a given vector and returns the indices of the elements.
Syntax:
order(vector / data frame)
Returns:
The indices of the sorted object (vector / data frame).
Documentation
help(order)
r-squared
Slide
10
order()
www.r-squared.in/rprogramming
Examples
> # example 1
> x <- sample(1:10)
> x
[1] 10 9 6 2 4 3 8 1 7 5
# let us sort x using the indices
> x[c(8, 4, 6, 5, 10, 3, 9, 7, 2, 1)]
[1] 1 2 3 4 5 6 7 8 9 10
> order(x)
[1] 8 4 6 5 10 3 9 7 2 1
> x[order(x)]
[1] 1 2 3 4 5 6 7 8 9 10
r-squared
Slide 11
order()
www.r-squared.in/rprogramming
Examples
> # example 2
> data_ascending <- data[order(data$mpg),]
> data_descending <- data[order(-data$mpg),]
> head(data_ascending)
mpg cyl disp hp drat wt qsec vs am gear carb
Cadillac Fleetwood 10.4 8 472 205 2.93 5.250 17.98 0 0 3 4
Lincoln Continental 10.4 8 460 215 3.00 5.424 17.82 0 0 3 4
Camaro Z28 13.3 8 350 245 3.73 3.840 15.41 0 0 3 4
Duster 360 14.3 8 360 245 3.21 3.570 15.84 0 0 3 4
Chrysler Imperial 14.7 8 440 230 3.23 5.345 17.42 0 0 3 4
Maserati Bora 15.0 8 301 335 3.54 3.570 14.60 0 1 5 8
> head(data_descending)
mpg cyl disp hp drat wt qsec vs am gear carb
Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1
Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1
Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2
Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2
Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1
Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2
r-squared
Slide 12
sort()
www.r-squared.in/rprogramming
Description:
sort() will sort the elements of a vector or factor in ascending/descending order.
Syntax:
sort(vector / factor)
Returns:
Sorted vector or factor in ascending/descending order
Documentation
help(sort)
r-squared
Slide 13
sort()
www.r-squared.in/rprogramming
Examples
> # example 1
> x <- sample(1:10)
> x
[1] 10 9 6 2 4 3 8 1 7 5
> sort(x) # ascending order
[1] 1 2 3 4 5 6 7 8 9 10
> # example 2
> x <- sample(1:10)
> x
[1] 10 9 6 2 4 3 8 1 7 5
> sort(x, decreasing = TRUE) # descending order
[1] 10 9 8 7 6 5 4 3 2 1
r-squared
Slide 14
rank()
www.r-squared.in/rprogramming
Description:
rank() returns the sample ranks of values in a vector.
Syntax:
rank(vector)
Returns:
Sample ranks of values in a vector.
Documentation
help(rank)
r-squared
Slide 15
rank()
www.r-squared.in/rprogramming
Examples
> # example 1
> x <- sample(1:10)
> x
[1] 7 9 1 8 6 5 3 2 10 4
> rank(x)
[1] 7 9 1 8 6 5 3 2 10 4
> # example 2
> x2 <- c(3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5)
> order(x2)
[1] 2 4 7 1 10 3 5 9 11 8 6
> sort(x2)
[1] 1 1 2 3 3 4 5 5 5 6 9
> (r2 <- rank(x2)) # ties are averaged
[1] 4.5 1.5 6.0 1.5 8.0 11.0 3.0 10.0 8.0 4.5 8.0
r-squared
Slide 16
Subset/Filter Data
www.r-squared.in/rprogramming
In this section, we will look at functions that can be used for subsetting/filtering data.
✓ subset
✓ which
✓ with
✓ drop
✓ droplevels
r-squared
Slide 17
subset()
www.r-squared.in/rprogramming
Description:
subset() can be used to subset data from vectors and data frames.
Syntax:
subset(vector / data frame)
Returns:
Vector or data frame.
Documentation
help(subset)
r-squared
Slide 18
subset()
www.r-squared.in/rprogramming
Examples
> # example 1
> # subsetting vectors
> x
[1] 7 9 1 8 6 5 3 2 10 4
> subset(x, x > 5)
[1] 7 9 8 6 10
> subset(x, x == 4)
[1] 4
> subset(x, x > 4 & x < 7)
[1] 6 5
r-squared
Slide 19
subset()
www.r-squared.in/rprogramming
Examples
> # example 2
> # subsetting data frames
> subset(mtcars, mpg >= 23 & mpg <= 27)
mpg cyl disp hp drat wt qsec vs am gear carb
Merc 240D 24.4 4 146.7 62 3.69 3.19 20.0 1 0 4 2
Porsche 914-2 26.0 4 120.3 91 4.43 2.14 16.7 0 1 5 2
> subset(mtcars, mpg >= 23 & mpg <= 27, select = c(cyl, hp))
cyl hp
Merc 240D 4 62
Porsche 914-2 4 91
> subset(mtcars, cyl == 4 & hp > 100, select = mpg:wt)
mpg cyl disp hp drat wt
Lotus Europa 30.4 4 95.1 113 3.77 1.513
Volvo 142E 21.4 4 121.0 109 4.11 2.780
r-squared
Slide 20
which()
www.r-squared.in/rprogramming
Description:
which() tests if the values in a object evaluate to TRUE for a given condition and return
the indices of such values.
Syntax:
which(object, condition)
Returns:
Indices of values which evaluate to TRUE for a given condition.
Documentation
help(which)
r-squared
Slide 21
which()
www.r-squared.in/rprogramming
Examples
> # example 1
> x
[1] 7 9 1 8 6 5 3 2 10 4
> which(x == 5) # returns index of value 5.
[1] 6
> which(x > 4) # returns indices of all values greater than 4.
[1] 1 2 4 5 6 9
> # example 2
> # using data frame
> which(data$mpg > 20) # returns indices of values greater than 20.
[1] 1 2 3 4 8 9 18 19 20 21 26 27 28 32
> data$mpg[which(data$mpg > 20)] # returns values greater than 20.
[1] 21.0 21.0 22.8 21.4 24.4 22.8 32.4 30.4 33.9 21.5 27.3 26.0 30.4 21.4
r-squared
Slide 22
which()
www.r-squared.in/rprogramming
Examples
> # example 3
> m
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
> which(m > 5)
[1] 6
> which(m == 5)
[1] 5
> which(letters == "r") # r is the 18th alphabet
[1] 18
> div_by_3 <- m %% 3 == 0
> div_by_3
[,1] [,2] [,3]
[1,] FALSE TRUE FALSE
[2,] FALSE FALSE TRUE
> which(div_by_3) # which values in m are divisible by 3.
[1] 3 6
r-squared
Slide 23
droplevels()
www.r-squared.in/rprogramming
Description:
droplevels() drops all unused levels from a factor.
Syntax:
droplevels(factor)
Returns:
Factors without unused levels.
Documentation
help(droplevels)
r-squared
Slide 24
droplevels()
www.r-squared.in/rprogramming
Examples
> # example 1
> data_cyl <- subset(data, cyl == 4 | cyl == 6)
> levels(data_cyl$cyl)
[1] "4" "6" "8"
> droplevels(data_cyl$cyl)
[1] 6 6 4 6 6 4 4 6 6 4 4 4 4 4 4 4 6 4
Levels: 4 6
> levels(data_cyl$cyl)
[1] "4" "6" "8"
> summary(droplevels(data_cyl$cyl))
4 6
11 7
r-squared
Slide 25
droplevels()
www.r-squared.in/rprogramming
Examples
> # example 2
> aq <- transform(airquality, Month = factor(Month, labels = month.abb[5:9]))
> aq <- subset(aq, Month != "Jul")
> table(aq$Month)
May Jun Jul Aug Sep
31 30 0 31 30
> table(droplevels(aq)$Month)
May Jun Aug Sep
31 30 31 30
> droplevels(data_cyl)$cyl
[1] 6 6 4 6 6 4 4 6 6 4 4 4 4 4 4 4 6 4
Levels: 4 6
> table(droplevels(data_cyl)$cyl)
4 6
11 7
> table(data_cyl$cyl)
4 6 8
11 7 0
r-squared
Slide
26
Combine Data
www.r-squared.in/rprogramming
In this section, we will look at functions that combine data.
✓ append
✓ merge
✓ cbind
✓ rbind
✓ interaction
r-squared
Slide 27
append()
www.r-squared.in/rprogramming
Description:
append() adds elements to a vector. We can specify the index where the element must be
added.
Syntax:
append(vector, elements)
Returns:
A vector with appended elements.
Documentation
help(append)
r-squared
Slide 28
append()
www.r-squared.in/rprogramming
Examples
> # example 1
> x1 <- sample(1:10)
> x2 <- sample(1:5)
> append(x1, x2)
[1] 8 7 4 9 5 10 6 1 2 3 2 5 3 1 4
> example 2
> x1 <- sample(1:10)
> x2 <- sample(1:5)
> append(x1, x2, after = 2)
[1] 8 7 2 5 3 1 4 4 9 5 10 6 1 2 3
r-squared
Slide 29
merge()
www.r-squared.in/rprogramming
Description:
merge() will merge two data frames by common column or row names.
Syntax:
merge(dataframe1, dataframe2, by)
Returns:
Data frame.
Documentation
help(merge)
r-squared
Slide 30
merge()
www.r-squared.in/rprogramming
Examples
> # example 1
> name <- c("John", "Jane", "Tom", "Jennifer")
> age <- c(20, 25, 30, 28)
> gender <- factor(c("male", "female", "male", "female"))
> data_1 <- data.frame(name, age)
> data_2 <- data.frame(name, gender)
> data_3 <- merge(data_1, data_2, by = "name")
> head(data_3)
name age gender
1 Jane 25 female
2 Jennifer 28 female
3 John 20 male
4 Tom 30 male
r-squared
Slide 31
cbind()
www.r-squared.in/rprogramming
Description:
cbind() combines objects by columns.
Syntax:
cbind(object1, object2)
Returns:
Matrix / Data frame
Documentation
help(cbind)
r-squared
Slide 32
cbind()
www.r-squared.in/rprogramming
Examples
> # example 1
> cbind(1, 1:4)
[,1] [,2]
[1,] 1 1
[2,] 1 2
[3,] 1 3
[4,] 1 4
> # example 2
> m1 <- matrix(1:4, nrow = 2)
> m2 <- matrix(5:8, nrow = 2)
> cbind(m1, m2)
[,1] [,2] [,3] [,4]
[1,] 1 3 5 7
[2,] 2 4 6 8
r-squared
Slide 33
cbind()
www.r-squared.in/rprogramming
Examples
> # example 3
> name <- c("John", "Jane", "Tom", "Jennifer")
> age <- c(20, 25, 30, 28)
> gender <- factor(c("male", "female", "male", "female"))
> data_1 <- data.frame(name, age)
> data_2 <- data.frame(name, gender)
> data_3 <- merge(data_1, data_2, by = "name")
> data_4 <- cbind(data_3, income)
> head(data_4)
name age gender income
1 Jane 25 female 25000
2 Jennifer 28 female 30000
3 John 20 male 35000
4 Tom 30 male 40000
r-squared
Slide 34
rbind()
www.r-squared.in/rprogramming
Description:
rbind() combines objects by rows.
Syntax:
rbind(object1, object2)
Returns:
Matrix / Data frame
Documentation
help(rbind)
r-squared
Slide 35
rbind()
www.r-squared.in/rprogramming
Examples
> # example 1
> rbind(1, 1:4)
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] 1 1 1 1 1 1 1 1
[2,] 1 2 3 4 5 6 7 8
> # example 2
> m1 <- matrix(1:4, nrow = 2)
> m2 <- matrix(5:8, nrow = 2)
> rbind(m1, m2)
[,1] [,2]
[1,] 1 3
[2,] 2 4
[3,] 5 7
[4,] 6 8
r-squared
Slide 36
rbind()
www.r-squared.in/rprogramming
Examples
> # example 3
> name <- c("John", "Jane", "Tom", "Jennifer")
> age <- c(20, 25, 30, 28)
> gender <- factor(c("male", "female", "male", "female"))
> data_1 <- data.frame(name, age)
> data_2 <- data.frame(name, gender)
> data_3 <- merge(data_1, data_2, by = "name")
> data_4 <- data_3
> data_rbind <- rbind(data_3, data_4)
> head(data_rbind)
name age gender
1 Jane 25 female
2 Jennifer 28 female
3 John 20 male
4 Tom 30 male
5 Jane 25 female
6 Jennifer 28 female
r-squared
Slide 37
interaction()
www.r-squared.in/rprogramming
Description:
interaction() creates interaction variables.
Syntax
interaction(factor1, factor2)
Returns:
Interaction variable.
Documentation
help(interaction)
r-squared
Slide 38
interaction()
www.r-squared.in/rprogramming
Examples
> # example 1
> mtcars$gear <- as.factor(mtcars$gear)
> mtcars$cyl <- as.factor(mtcars$cyl)
> interaction(mtcars$cyl, mtcars$gear)
[1] 6.4 6.4 4.4 6.3 8.3 6.3 8.3 4.4 4.4 6.4 6.4 8.3 8.3 8.3 8.3 8.3 8.3 4.4 4.4 4.4
[21] 4.3 8.3 8.3 8.3 8.3 4.4 4.5 4.5 8.5 6.5 8.5 4.4
Levels: 4.3 6.3 8.3 4.4 6.4 8.4 4.5 6.5 8.5
> # example 2
> mtcars$am <- as.factor(mtcars$am)
> mtcars$cyl <- as.factor(mtcars$cyl)
> interaction(mtcars$cyl, mtcars$am)
[1] 6.1 6.1 4.1 6.0 8.0 6.0 8.0 4.0 4.0 6.0 6.0 8.0 8.0 8.0 8.0 8.0 8.0 4.1 4.1 4.1
[21] 4.0 8.0 8.0 8.0 8.0 4.1 4.1 4.1 8.1 6.1 8.1 4.1
Levels: 4.0 6.0 8.0 4.1 6.1 8.1
r-squared
Slide 39
Reshape Data
www.r-squared.in/rprogramming
In this section, we will look at functions that transform/reshape data.
✓ transform
✓ cut
✓ diff
✓ replace
✓ scale
✓ split
✓ with
✓ within
✓ by
r-squared
Slide 40
transform()
www.r-squared.in/rprogramming
Description:
transform() is used to transform variables in a data frame.
Syntax
transform(data frame, expression)
Returns:
Data frame with transformed variables.
Documentation
help(transform)
r-squared
Slide 41
transform()
www.r-squared.in/rprogramming
Examples
> # example 1
> data <- mtcars
> head(data)
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1
> head(transform(data, mpg = -mpg, disp = disp / wt))
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 -21.0 6 61.06870 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag -21.0 6 55.65217 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 -22.8 4 46.55172 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive -21.4 6 80.24883 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout -18.7 8 104.65116 175 3.15 3.440 17.02 0 0 3 2
Valiant -18.1 6 65.02890 105 2.76 3.460 20.22 1 0 3 1
r-squared
Slide 42
transform()
www.r-squared.in/rprogramming
Examples
> # example 2
> data <- mtcars
> head(transform(data, wtdrat = wt * drat))
mpg cyl disp hp drat wt qsec vs am gear carb wtdrat
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 10.2180
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 11.2125
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 8.9320
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 9.9022
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 10.8360
Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1 9.5496
r-squared
Slide 43
cut()
www.r-squared.in/rprogramming
Description:
cut() divides the range of an object into intervals.
Syntax
cut(object, breaks)
Returns:
Intervals
Documentation
help(cut)
r-squared
Slide 44
transform()
www.r-squared.in/rprogramming
Examples
> # example 1
> x <- jitter(sample(1:100))
> x
[1] 69.8630359 44.8489212 61.1385505 50.8402454 26.0350033 97.0510463 42.8749472
[8] 2.0313452 69.0713593 9.1714536 64.8470522 62.8787114 98.9115336 58.8020429
[15] 81.9908416 87.1495953 16.9303676 11.9593307 38.0015233 20.1833953 14.0838761
………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………
[85] 3.0042776 33.9052141 97.8309652 47.1207229 77.1890815 41.8063134 39.9223398
[92] 27.8306122 80.0271128 18.1951342 85.1410689 23.1750646 6.1861739 27.0493739
[99] 36.9679664 18.9148518
> c <- cut(x, breaks = 10)
> table(c)
c
(0.827,10.8] (10.8,20.8] (20.8,30.7] (30.7,40.6] (40.6,50.5] (50.5,60.4] (60.4,70.3]
10 10 10 10 10 10 10
(70.3,80.3] (80.3,90.2] (90.2,100]
10 10 10
r-squared
Slide 45
diff()
www.r-squared.in/rprogramming
Description:
diff() creates sequences with lags and iterated differences.
Syntax
diff(object, lag)
Returns:
Lagged sequence
Documentation
help(diff)
r-squared
Slide 46
diff()
www.r-squared.in/rprogramming
Examples
> # example 1
> diff(1:10, 2)
[1] 2 2 2 2 2 2 2 2
> diff(1:10, 2, 2)
[1] 0 0 0 0 0 0
> x <- cumsum(cumsum(1:10))
> x
[1] 1 4 10 20 35 56 84 120 165 220
> diff(x, lag = 2)
[1] 9 16 25 36 49 64 81 100
r-squared
Slide 47
replace()
www.r-squared.in/rprogramming
Description:
replace() replaces the elements in object given by indices in list with values.
Syntax
replace(object, list, values)
Returns:
New object with replaced values.
Documentation
help(replace)
r-squared
Slide 48
replace()
www.r-squared.in/rprogramming
Examples
> # example 1
> x <- sample(1:10)
> x
[1] 6 2 7 9 1 5 4 8 10 3
> replace(x, 5, 10)
[1] 6 2 7 9 10 5 4 8 10 3
# replace the value in the index position 5 in the vector x with the value 10.
> # example 1
> x <- sample(1:10)
> x
[1] 6 2 7 9 1 5 4 8 10 3
> replace(x, 3:5, c(2, 4, 6))
[1] 6 2 2 4 6 5 4 8 10 3
r-squared
Slide 49
scale()
www.r-squared.in/rprogramming
Description:
scale() scales the columns of a numeric matrix.
Syntax
scale(numeric matrix)
Returns:
Matrix with scaled columns
Documentation
help(scale)
r-squared
Slide 50
scale()
www.r-squared.in/rprogramming
Examples
> # example 1
> m <- matrix(1:9, nrow = 3)
> m
[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
> scale(m)
[,1] [,2] [,3]
[1,] -1 -1 -1
[2,] 0 0 0
[3,] 1 1 1
attr(,"scaled:center")
[1] 2 5 8
attr(,"scaled:scale")
[1] 1 1 1
r-squared
Slide 51
split()
www.r-squared.in/rprogramming
Description:
split() divides the data in the vector x into the groups defined by f.
Syntax
split(x, f)
Returns:
x split into groups defined by f.
Documentation
help(split)
r-squared
Slide 52
split()
www.r-squared.in/rprogramming
Examples
> # example 1
> x <- split(data$mpg, data$cyl)
> x
$`4`
[1] 22.8 24.4 22.8 32.4 30.4 33.9 21.5 27.3 26.0 30.4 21.4
$`6`
[1] 21.0 21.0 21.4 18.1 19.2 17.8 19.7
$`8`
[1] 18.7 14.3 16.4 17.3 15.2 10.4 10.4 14.7 15.5 15.2 13.3 19.2 15.8 15.0
> sapply(x, mean)
4 6 8
26.66364 19.74286 15.10000
> unsplit(x, data$cyl)
[1] 21.0 21.0 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 17.8 16.4 17.3 15.2 10.4 10.4 14.7 32.4 [19]
30.4 33.9 21.5 15.5 15.2 13.3 19.2 27.3 26.0 30.4 15.8 19.7 15.0 21.4
r-squared
Slide 53
with()
www.r-squared.in/rprogramming
Description:
with() applies an expression to an object.
Syntax
with(object, expression)
Returns:
Result of the expression
Documentation
help(with)
r-squared
Slide 54
with()
www.r-squared.in/rprogramming
Examples
> # example 1
> with(mtcars, table(cyl))
cyl
4 6 8
11 7 14
> with(mtcars, summary(mpg))
Min. 1st Qu. Median Mean 3rd Qu. Max.
10.40 15.42 19.20 20.09 22.80 33.90
> with(mtcars, lm(mpg ~ hp))
Call:
lm(formula = mpg ~ hp)
Coefficients:
(Intercept) hp
30.09886 -0.06823
r-squared
Slide 55
within()
www.r-squared.in/rprogramming
Description:
within() applies an expression to an object and returns a copy of the modified object.
Syntax
within(object, expression)
Returns:
Copy of the modified object
Documentation
help(within)
r-squared
Slide 56
within()
www.r-squared.in/rprogramming
Examples
> # example 1
> data <- mtcars
> data <- within(data, mpg_cyl <- mpg * cyl)
> head(data)
mpg cyl disp hp drat wt qsec vs am gear carb mpg_cyl
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 126.0
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 126.0
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 91.2
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 128.4
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 149.6
Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1 108.6
r-squared
Slide 57
by()
www.r-squared.in/rprogramming
Description:
by() applies an expression to each level of a factor in an object
Syntax
by(object, factor, expression)
Returns:
Result of the expression applied to different levels of the factor
Documentation
help(by)
r-squared
Slide 58
by()
www.r-squared.in/rprogramming
Examples
> # example 1
> by(mtcars$mpg, mtcars$cyl, summary)
mtcars$cyl: 4
Min. 1st Qu. Median Mean 3rd Qu. Max.
21.40 22.80 26.00 26.66 30.40 33.90
----------------------------------------------------------------
mtcars$cyl: 6
Min. 1st Qu. Median Mean 3rd Qu. Max.
17.80 18.65 19.70 19.74 21.00 21.40
----------------------------------------------------------------
mtcars$cyl: 8
Min. 1st Qu. Median Mean 3rd Qu. Max.
10.40 14.40 15.20 15.10 16.25 19.20
r-squared
In the next unit, we will explore the following numeric functions:
Slide 59
Next Steps...
www.r-squared.in/rprogramming
● signif()
● jitter()
● format()
● formatC()
● abs()
● round()
● ceiling()
● floor()
r-squared
Slide
60
Connect With Us
www.r-squared.in/rprogramming
Visit r-squared for tutorials
on:
● R Programming
● Business Analytics
● Data Visualization
● Web Applications
● Package Development
● Git & GitHub

Contenu connexe

Tendances

2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factors2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factorskrishna singh
 
Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptxAkshayAggarwal79
 
Files and Directories in PHP
Files and Directories in PHPFiles and Directories in PHP
Files and Directories in PHPNicole Ryan
 
2 R Tutorial Programming
2 R Tutorial Programming2 R Tutorial Programming
2 R Tutorial ProgrammingSakthi Dasans
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL CommandsShrija Madhu
 
Data visualization in Python
Data visualization in PythonData visualization in Python
Data visualization in PythonMarc Garcia
 
Ppt of dbms e r features
Ppt of dbms e r featuresPpt of dbms e r features
Ppt of dbms e r featuresNirali Akabari
 
Chart and graphs in R programming language
Chart and graphs in R programming language Chart and graphs in R programming language
Chart and graphs in R programming language CHANDAN KUMAR
 
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...Doug Jones
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in PythonDevashish Kumar
 
Python Exception Handling
Python Exception HandlingPython Exception Handling
Python Exception HandlingMegha V
 
Applications of data structures
Applications of data structuresApplications of data structures
Applications of data structuresWipro
 

Tendances (20)

Python programming : Control statements
Python programming : Control statementsPython programming : Control statements
Python programming : Control statements
 
MYSQL
MYSQLMYSQL
MYSQL
 
LR Parsing
LR ParsingLR Parsing
LR Parsing
 
Python exception handling
Python   exception handlingPython   exception handling
Python exception handling
 
2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factors2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factors
 
Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptx
 
Files and Directories in PHP
Files and Directories in PHPFiles and Directories in PHP
Files and Directories in PHP
 
Compiler design lab programs
Compiler design lab programs Compiler design lab programs
Compiler design lab programs
 
2 R Tutorial Programming
2 R Tutorial Programming2 R Tutorial Programming
2 R Tutorial Programming
 
Introduction to triggers
Introduction to triggersIntroduction to triggers
Introduction to triggers
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
SQL Joins.pdf
SQL Joins.pdfSQL Joins.pdf
SQL Joins.pdf
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Data visualization in Python
Data visualization in PythonData visualization in Python
Data visualization in Python
 
Ppt of dbms e r features
Ppt of dbms e r featuresPpt of dbms e r features
Ppt of dbms e r features
 
Chart and graphs in R programming language
Chart and graphs in R programming language Chart and graphs in R programming language
Chart and graphs in R programming language
 
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
 
Python Exception Handling
Python Exception HandlingPython Exception Handling
Python Exception Handling
 
Applications of data structures
Applications of data structuresApplications of data structures
Applications of data structures
 

En vedette

Data processing with spark in r &amp; python
Data processing with spark in r &amp; pythonData processing with spark in r &amp; python
Data processing with spark in r &amp; pythonMaloy Manna, PMP®
 
R Programming: Export/Output Data In R
R Programming: Export/Output Data In RR Programming: Export/Output Data In R
R Programming: Export/Output Data In RRsquared Academy
 
R Programming: Getting Help In R
R Programming: Getting Help In RR Programming: Getting Help In R
R Programming: Getting Help In RRsquared Academy
 
R Programming: Introduction To R Packages
R Programming: Introduction To R PackagesR Programming: Introduction To R Packages
R Programming: Introduction To R PackagesRsquared Academy
 
North and central caspian basin play maps
North and central caspian basin play mapsNorth and central caspian basin play maps
North and central caspian basin play mapsDr. Arzu Javadova
 
VERANDA POINTES RESORT MAURITIUS PACKAGE $ 1950
VERANDA POINTES RESORT MAURITIUS PACKAGE $ 1950VERANDA POINTES RESORT MAURITIUS PACKAGE $ 1950
VERANDA POINTES RESORT MAURITIUS PACKAGE $ 1950Shahrukh Hussain
 
PARTECIPAZIONE E TRASPARENZA
PARTECIPAZIONE E TRASPARENZAPARTECIPAZIONE E TRASPARENZA
PARTECIPAZIONE E TRASPARENZAFranco Amorese
 
Athens City Break 3 Nights 4 Star $ 350
Athens City Break 3 Nights 4 Star $ 350Athens City Break 3 Nights 4 Star $ 350
Athens City Break 3 Nights 4 Star $ 350Shahrukh Hussain
 
Word-A-Holic-Z 006- Vocab Masters (Edu Right Foundation)
Word-A-Holic-Z 006- Vocab Masters (Edu Right Foundation)Word-A-Holic-Z 006- Vocab Masters (Edu Right Foundation)
Word-A-Holic-Z 006- Vocab Masters (Edu Right Foundation)Amit Kumar
 
Version Control With GitHub & RStudio
Version Control With GitHub & RStudioVersion Control With GitHub & RStudio
Version Control With GitHub & RStudioRsquared Academy
 
R Programming: First Steps
R Programming: First StepsR Programming: First Steps
R Programming: First StepsRsquared Academy
 
HERITAGE AWALI RESORT MAURITIUS PACKAGE $ 2490
HERITAGE AWALI RESORT MAURITIUS PACKAGE $ 2490HERITAGE AWALI RESORT MAURITIUS PACKAGE $ 2490
HERITAGE AWALI RESORT MAURITIUS PACKAGE $ 2490Shahrukh Hussain
 
R Data Visualization Tutorial: Bar Plots
R Data Visualization Tutorial: Bar PlotsR Data Visualization Tutorial: Bar Plots
R Data Visualization Tutorial: Bar PlotsRsquared Academy
 
Introduction to data science
Introduction to data scienceIntroduction to data science
Introduction to data scienceKoo Ping Shung
 
Catcote Academy Erasmus + visit March2016
Catcote Academy Erasmus + visit March2016Catcote Academy Erasmus + visit March2016
Catcote Academy Erasmus + visit March2016Emma Straker
 
The transition of intellectually disabled students from school to world of work
The transition of intellectually disabled students from school to world of workThe transition of intellectually disabled students from school to world of work
The transition of intellectually disabled students from school to world of worközlem yeşiltepe
 
Historical occupational classification and occupational stratification schemes
Historical occupational classification and occupational stratification schemesHistorical occupational classification and occupational stratification schemes
Historical occupational classification and occupational stratification schemesRichard Zijdeman
 

En vedette (20)

Reshaping Data in R
Reshaping Data in RReshaping Data in R
Reshaping Data in R
 
01 Intro
01 Intro01 Intro
01 Intro
 
Data processing with spark in r &amp; python
Data processing with spark in r &amp; pythonData processing with spark in r &amp; python
Data processing with spark in r &amp; python
 
R Programming: Export/Output Data In R
R Programming: Export/Output Data In RR Programming: Export/Output Data In R
R Programming: Export/Output Data In R
 
R Programming: Getting Help In R
R Programming: Getting Help In RR Programming: Getting Help In R
R Programming: Getting Help In R
 
R Programming: Introduction To R Packages
R Programming: Introduction To R PackagesR Programming: Introduction To R Packages
R Programming: Introduction To R Packages
 
North and central caspian basin play maps
North and central caspian basin play mapsNorth and central caspian basin play maps
North and central caspian basin play maps
 
VERANDA POINTES RESORT MAURITIUS PACKAGE $ 1950
VERANDA POINTES RESORT MAURITIUS PACKAGE $ 1950VERANDA POINTES RESORT MAURITIUS PACKAGE $ 1950
VERANDA POINTES RESORT MAURITIUS PACKAGE $ 1950
 
PARTECIPAZIONE E TRASPARENZA
PARTECIPAZIONE E TRASPARENZAPARTECIPAZIONE E TRASPARENZA
PARTECIPAZIONE E TRASPARENZA
 
IEP Tip Sheet
IEP Tip SheetIEP Tip Sheet
IEP Tip Sheet
 
Athens City Break 3 Nights 4 Star $ 350
Athens City Break 3 Nights 4 Star $ 350Athens City Break 3 Nights 4 Star $ 350
Athens City Break 3 Nights 4 Star $ 350
 
Word-A-Holic-Z 006- Vocab Masters (Edu Right Foundation)
Word-A-Holic-Z 006- Vocab Masters (Edu Right Foundation)Word-A-Holic-Z 006- Vocab Masters (Edu Right Foundation)
Word-A-Holic-Z 006- Vocab Masters (Edu Right Foundation)
 
Version Control With GitHub & RStudio
Version Control With GitHub & RStudioVersion Control With GitHub & RStudio
Version Control With GitHub & RStudio
 
R Programming: First Steps
R Programming: First StepsR Programming: First Steps
R Programming: First Steps
 
HERITAGE AWALI RESORT MAURITIUS PACKAGE $ 2490
HERITAGE AWALI RESORT MAURITIUS PACKAGE $ 2490HERITAGE AWALI RESORT MAURITIUS PACKAGE $ 2490
HERITAGE AWALI RESORT MAURITIUS PACKAGE $ 2490
 
R Data Visualization Tutorial: Bar Plots
R Data Visualization Tutorial: Bar PlotsR Data Visualization Tutorial: Bar Plots
R Data Visualization Tutorial: Bar Plots
 
Introduction to data science
Introduction to data scienceIntroduction to data science
Introduction to data science
 
Catcote Academy Erasmus + visit March2016
Catcote Academy Erasmus + visit March2016Catcote Academy Erasmus + visit March2016
Catcote Academy Erasmus + visit March2016
 
The transition of intellectually disabled students from school to world of work
The transition of intellectually disabled students from school to world of workThe transition of intellectually disabled students from school to world of work
The transition of intellectually disabled students from school to world of work
 
Historical occupational classification and occupational stratification schemes
Historical occupational classification and occupational stratification schemesHistorical occupational classification and occupational stratification schemes
Historical occupational classification and occupational stratification schemes
 

Similaire à R Programming: Transform/Reshape Data In R

R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In RRsquared Academy
 
MH prediction modeling and validation in r (1) regression 190709
MH prediction modeling and validation in r (1) regression 190709MH prediction modeling and validation in r (1) regression 190709
MH prediction modeling and validation in r (1) regression 190709Min-hyung Kim
 
Applied Regression Analysis using R
Applied Regression Analysis using RApplied Regression Analysis using R
Applied Regression Analysis using RTarek Dib
 
Introduction to R
Introduction to RIntroduction to R
Introduction to RStacy Irwin
 
Descriptive analytics in r programming language
Descriptive analytics in r programming languageDescriptive analytics in r programming language
Descriptive analytics in r programming languageAshwini Mathur
 
SevillaR meetup: dplyr and magrittr
SevillaR meetup: dplyr and magrittrSevillaR meetup: dplyr and magrittr
SevillaR meetup: dplyr and magrittrRomain Francois
 
第5回 様々なファイル形式の読み込みとデータの書き出し
第5回 様々なファイル形式の読み込みとデータの書き出し第5回 様々なファイル形式の読み込みとデータの書き出し
第5回 様々なファイル形式の読み込みとデータの書き出しWataru Shito
 
R Programming: Mathematical Functions In R
R Programming: Mathematical Functions In RR Programming: Mathematical Functions In R
R Programming: Mathematical Functions In RRsquared Academy
 
第5回 様々なファイル形式の読み込みとデータの書き出し(解答付き)
第5回 様々なファイル形式の読み込みとデータの書き出し(解答付き)第5回 様々なファイル形式の読み込みとデータの書き出し(解答付き)
第5回 様々なファイル形式の読み込みとデータの書き出し(解答付き)Wataru Shito
 
Grouping & Summarizing Data in R
Grouping & Summarizing Data in RGrouping & Summarizing Data in R
Grouping & Summarizing Data in RJeffrey Breen
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on rAbhik Seal
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyrRomain Francois
 
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介Masayuki Matsushita
 
Accessing Databases from R
Accessing Databases from RAccessing Databases from R
Accessing Databases from Rkmettler
 
Accessing Databases from R
Accessing Databases from RAccessing Databases from R
Accessing Databases from RJeffrey Breen
 

Similaire à R Programming: Transform/Reshape Data In R (20)

R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In R
 
MH prediction modeling and validation in r (1) regression 190709
MH prediction modeling and validation in r (1) regression 190709MH prediction modeling and validation in r (1) regression 190709
MH prediction modeling and validation in r (1) regression 190709
 
Applied Regression Analysis using R
Applied Regression Analysis using RApplied Regression Analysis using R
Applied Regression Analysis using R
 
chapter3
chapter3chapter3
chapter3
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
R programming language
R programming languageR programming language
R programming language
 
Descriptive analytics in r programming language
Descriptive analytics in r programming languageDescriptive analytics in r programming language
Descriptive analytics in r programming language
 
SevillaR meetup: dplyr and magrittr
SevillaR meetup: dplyr and magrittrSevillaR meetup: dplyr and magrittr
SevillaR meetup: dplyr and magrittr
 
第5回 様々なファイル形式の読み込みとデータの書き出し
第5回 様々なファイル形式の読み込みとデータの書き出し第5回 様々なファイル形式の読み込みとデータの書き出し
第5回 様々なファイル形式の読み込みとデータの書き出し
 
R Programming: Mathematical Functions In R
R Programming: Mathematical Functions In RR Programming: Mathematical Functions In R
R Programming: Mathematical Functions In R
 
Tsukubar8
Tsukubar8Tsukubar8
Tsukubar8
 
R and data mining
R and data miningR and data mining
R and data mining
 
第5回 様々なファイル形式の読み込みとデータの書き出し(解答付き)
第5回 様々なファイル形式の読み込みとデータの書き出し(解答付き)第5回 様々なファイル形式の読み込みとデータの書き出し(解答付き)
第5回 様々なファイル形式の読み込みとデータの書き出し(解答付き)
 
Grouping & Summarizing Data in R
Grouping & Summarizing Data in RGrouping & Summarizing Data in R
Grouping & Summarizing Data in R
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on r
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyr
 
Cluto presentation
Cluto presentationCluto presentation
Cluto presentation
 
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
クラウドDWHとしても進化を続けるPivotal Greenplumご紹介
 
Accessing Databases from R
Accessing Databases from RAccessing Databases from R
Accessing Databases from R
 
Accessing Databases from R
Accessing Databases from RAccessing Databases from R
Accessing Databases from R
 

Plus de Rsquared Academy

Market Basket Analysis in R
Market Basket Analysis in RMarket Basket Analysis in R
Market Basket Analysis in RRsquared Academy
 
Practical Introduction to Web scraping using R
Practical Introduction to Web scraping using RPractical Introduction to Web scraping using R
Practical Introduction to Web scraping using RRsquared Academy
 
Writing Readable Code with Pipes
Writing Readable Code with PipesWriting Readable Code with Pipes
Writing Readable Code with PipesRsquared Academy
 
Read data from Excel spreadsheets into R
Read data from Excel spreadsheets into RRead data from Excel spreadsheets into R
Read data from Excel spreadsheets into RRsquared Academy
 
Read/Import data from flat/delimited files into R
Read/Import data from flat/delimited files into RRead/Import data from flat/delimited files into R
Read/Import data from flat/delimited files into RRsquared Academy
 
Variables & Data Types in R
Variables & Data Types in RVariables & Data Types in R
Variables & Data Types in RRsquared Academy
 
How to install & update R packages?
How to install & update R packages?How to install & update R packages?
How to install & update R packages?Rsquared Academy
 
RMySQL Tutorial For Beginners
RMySQL Tutorial For BeginnersRMySQL Tutorial For Beginners
RMySQL Tutorial For BeginnersRsquared Academy
 
R Markdown Tutorial For Beginners
R Markdown Tutorial For BeginnersR Markdown Tutorial For Beginners
R Markdown Tutorial For BeginnersRsquared Academy
 
R Programming: Introduction to Matrices
R Programming: Introduction to MatricesR Programming: Introduction to Matrices
R Programming: Introduction to MatricesRsquared Academy
 
R Programming: Introduction to Vectors
R Programming: Introduction to VectorsR Programming: Introduction to Vectors
R Programming: Introduction to VectorsRsquared Academy
 
R Programming: Variables & Data Types
R Programming: Variables & Data TypesR Programming: Variables & Data Types
R Programming: Variables & Data TypesRsquared Academy
 
Data Visualization With R: Learn To Combine Multiple Graphs
Data Visualization With R: Learn To Combine Multiple GraphsData Visualization With R: Learn To Combine Multiple Graphs
Data Visualization With R: Learn To Combine Multiple GraphsRsquared Academy
 

Plus de Rsquared Academy (20)

Handling Date & Time in R
Handling Date & Time in RHandling Date & Time in R
Handling Date & Time in R
 
Market Basket Analysis in R
Market Basket Analysis in RMarket Basket Analysis in R
Market Basket Analysis in R
 
Practical Introduction to Web scraping using R
Practical Introduction to Web scraping using RPractical Introduction to Web scraping using R
Practical Introduction to Web scraping using R
 
Joining Data with dplyr
Joining Data with dplyrJoining Data with dplyr
Joining Data with dplyr
 
Explore Data using dplyr
Explore Data using dplyrExplore Data using dplyr
Explore Data using dplyr
 
Data Wrangling with dplyr
Data Wrangling with dplyrData Wrangling with dplyr
Data Wrangling with dplyr
 
Writing Readable Code with Pipes
Writing Readable Code with PipesWriting Readable Code with Pipes
Writing Readable Code with Pipes
 
Introduction to tibbles
Introduction to tibblesIntroduction to tibbles
Introduction to tibbles
 
Read data from Excel spreadsheets into R
Read data from Excel spreadsheets into RRead data from Excel spreadsheets into R
Read data from Excel spreadsheets into R
 
Read/Import data from flat/delimited files into R
Read/Import data from flat/delimited files into RRead/Import data from flat/delimited files into R
Read/Import data from flat/delimited files into R
 
Variables & Data Types in R
Variables & Data Types in RVariables & Data Types in R
Variables & Data Types in R
 
How to install & update R packages?
How to install & update R packages?How to install & update R packages?
How to install & update R packages?
 
How to get help in R?
How to get help in R?How to get help in R?
How to get help in R?
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
RMySQL Tutorial For Beginners
RMySQL Tutorial For BeginnersRMySQL Tutorial For Beginners
RMySQL Tutorial For Beginners
 
R Markdown Tutorial For Beginners
R Markdown Tutorial For BeginnersR Markdown Tutorial For Beginners
R Markdown Tutorial For Beginners
 
R Programming: Introduction to Matrices
R Programming: Introduction to MatricesR Programming: Introduction to Matrices
R Programming: Introduction to Matrices
 
R Programming: Introduction to Vectors
R Programming: Introduction to VectorsR Programming: Introduction to Vectors
R Programming: Introduction to Vectors
 
R Programming: Variables & Data Types
R Programming: Variables & Data TypesR Programming: Variables & Data Types
R Programming: Variables & Data Types
 
Data Visualization With R: Learn To Combine Multiple Graphs
Data Visualization With R: Learn To Combine Multiple GraphsData Visualization With R: Learn To Combine Multiple Graphs
Data Visualization With R: Learn To Combine Multiple Graphs
 

Dernier

Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...shambhavirathore45
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...shivangimorya083
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxolyaivanovalion
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 

Dernier (20)

Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 

R Programming: Transform/Reshape Data In R