R - Assignment
R - Assignment
(c) √
(d) 54%3
436
12
(e) 54/3
(f) Find cube of 999
(g)
Answers- a. (38-17)*27
= [1] 567
Problem 3: Create a list of two vectors containing integers (numbers from 1 to 10 in one and
5 to 15 in other)
Index the 8th element of the first list and 8th element of second list
Unlist the second back to atomic vectors
Subset the new list from 6th element to 14th element
Answer - X <- c(3, 2, 4)
Y<-c(1,2)
Z<-X*Y
## Warning in X * Y: longer object length is not a multiple of shorter object
## length
Z
## [1] 3 4 4
Problem 4: Create a list of 5 states having state name as variable name and number of
covid-19 cases as its values.
A. Access a few values through its variable name use $ to do so.
B. Find the class and length of the list
C. Subset the third state and its value.
library(dslabs)
data(murders)