Do we need to create vectors to create arrays in R?

0 votes
Do we need to create vectors to create arrays in R?
Oct 15 in Data Analytics by ch
• 3,290 points
20 views

1 answer to this question.

0 votes

Yes, you need vectors to create arrays. Arrays take vectors in the form of input and use the values in the dim parameter for creating an array.

array(x, dim) where x is a vector.

> array(c(1:10),c(3,3))
     [,1] [,2] [,3]
[1,]    1    4    7
[2,]    2    5    8
[3,]    3    6    9

answered Oct 28 by Cherukuri
• 32,260 points

Related Questions In Data Analytics

0 votes
1 answer
+1 vote
1 answer

Need a hadoop engine in backend to run r server

Dear Koushik, Hope you are doing great. The hadoop ...READ MORE

answered Dec 17, 2017 in Data Analytics by Sudhir
• 1,610 points
74 views
0 votes
1 answer

How to create excellent examples in R?

An excellent example must consist of the ...READ MORE

answered Apr 10, 2018 in Data Analytics by kappa3010
• 2,070 points

edited Apr 12, 2018 by kappa3010 43 views
0 votes
1 answer

How to create dummy variables based on a categorical variable of lists in R?

You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE

answered Apr 13, 2018 in Data Analytics by CodingByHeart77
• 3,690 points
618 views
0 votes
1 answer

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 17, 2017 in Data Analytics by Sudhir
• 1,610 points
67 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,560 points
86 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,560 points
253 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,560 points
137 views
0 votes
2 answers

How to create a table in R without external file?

Tibble also creates a table-like structure. Use below ...READ MORE

answered Sep 3 in Data Analytics by anonymous
• 32,260 points
76 views
0 votes
1 answer

How to create a Heatmap in R?

Its very simple. Use heatmap function and ...READ MORE

answered Nov 3 in Data Analytics by Cherukuri
• 32,260 points
38 views