Exercise 1 Create an array (3 dimensional) of 24 elements using the dim() function. Exercise 2 Create an array (3 dimensional) of 24 elements using the array() function. Exercise 3 Assign some dimnames of your choice to the array using the dimnames() function. Exercise 4 Assign some dimnames of your choice to the array using […]
Please note, solutions are available here. Exercise 1 Create three vectors x,y,z with integers and each vector has 3 elements. Combine the three vectors to become a 3×3 matrix A where each column represents a vector. Change the row names to a,b,c. Think: How about each row represents a vector, can you modify your code […]
Before you start, enter the following code: data How difficult was this for you? (1 star=easy, 10 stars=hard) Are you a beginner (1 star), intermediate (2 stars) or advanced (3 stars) R user?
Below are the solutions to these regular sequence exercises. # Excercise 1 # Using the seq() function generate the sequence 2,5,8,11 seq(from = 2,to = 13,by = 3) ##  2 5 8 11 # Exercise 2: # Use the seq() function to generate the sequence 9,18,27,36,45 seq(from = 9, to = 45, by = […]
Before proceeding, please review Chapter 2 of An Introduction to R and the internal R Documentation for the seq() function (type ?seq in the R console). Solutions are available here. Excercise 1 Using the seq() function, generate the sequence 2, 5, 8, 11. Exercise 2 Use the seq() function to generate the sequence 9, […]
Below are the solutions to these vector exercises. Exercise 1 answer e Exercise 2 answer e Exercise 3 answer c Exercise 4 answer b Exercise 5 answer d Exercise 6 answer c Exercise 7 answer c Exercise 8 answer c Please help us to improve R-exercises: Did you […]
A vector is a simple data structure in R. You will use it frequently, often as a building block of more complex data structures and operations on those structures. Before proceeding, please review Chapter 2 of An Introduction to R. First, write down your answer, without using R and without looking at the answer options. […]