Create an array (3 dimensional) of 24 elements using the
Assign some dimnames of your choice to the array using the
Assign some dimnames of your choice to the array using the arguments of the
Instead of column-major array, make a row-major array (transpose).
For this exercise, and all that follow, download this file, and read it into R using the
read.csv() function, e.g.:
Copy the column named
N into a new variable
Set dimensions of this variable and convert it into a 3 * 2 * 4 array. Add dimnames.
Print the whole array on the screen.
Print only elements of height 2, assuming the first dimension represents rows, the second columns and the third heigth.
Print elements of height 1 and columns 3 and 1.
Print element of height 2, column 4 and row 2.
Repeat the exercises 9-11, but instead of using numbers to reference row, column and height, use
- Become a Top R Programmer Fast with our Individual Coaching Program
- Explore all our (>4000) R exercises
- Find an R course using our R Course Finder directory
- Subscribe to receive weekly updates and bonus sets by email
- Share with your friends and colleagues using the buttons below