w3resource

R Programming: Create a two-dimensional 5×3 array of sequence of even integers greater than 50

R Programming: Array Exercise-7 with Solution

Write a R program to create a two-dimensional 5×3 array of sequence of even integers greater than 50.

Sample Solution :

R Programming Code :

a <- array(seq(from = 50, length.out = 15, by = 2), c(5, 3))
print("Content of the array:")
print("5×3 array of sequence of even integers greater than 50:")
print(a)

Sample Output:

[1] "Content of the array:"
[1] "5×3 array of sequence of even integers greater than 50:"
     [,1] [,2] [,3]
[1,]   50   60   70
[2,]   52   62   72
[3,]   54   64   74
[4,]   56   66   76
[5,]   58   68   78                         

R Programming Code Editor:



Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: 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.

Test your Programming skills with w3resource's quiz.

What is the difficulty level of this exercise?



Follow us on Facebook and Twitter for latest update.