w3resource

R Programming Array: Exercises, Practice, Solution

[An editor is available at the bottom of the page to write and execute the scripts.]

R Programming Array [7 exercises with solution]

1. Write a R program to convert a given matrix to a 1 dimensional array. Go to the editor
Click me to see the sample solution

2. Write a R program to create an array of two 3x3 matrices each with 3 rows and 3 columns from two given two vectors. Go to the editor
Click me to see the sample solution

3. Write a R program to create an 3 dimensional array of 24 elements using the dim() function. Go to the editor
Click me to see the sample solution

4. Write a R program to create an array of two 3x3 matrices each with 3 rows and 3 columns from two given two vectors. Print the second row of the second matrix of the array and the element in the 3rd row and 3rd column of the 1st matrix. Go to the editor
Click me to see the sample solution

5. Write a R program to combine three arrays so that the first row of the first array is followed by the first row of the second array and then first row of the third array. Go to the editor
Click me to see the sample solution

6. Write a R program to create an array using four given columns, three given rows, and two given tables and display the content of the array. Go to the editor
Click me to see the sample solution

7. Write a R program to create a two-dimensional 5x3 array of sequence of even integers greater than 50. Go to the editor
Click me to see the sample solution

R Programming Code Editor:


More to Come !

Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.