In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this article, the editor introduces in detail "how to create an array in R language". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to create an array in R language" can help you solve your doubts. Let's follow the editor's ideas to learn new knowledge.
Array is a generalization of vectors and matrices, which is multi-dimensional (three-dimensional or more) data. Like vectors and matrices, the elements of an array must be the same type of data. For example-if we create an array of dimensions (2dy3 and 4), we will create four rectangular matrices, each with two rows and three columns.
Create an array
In R, you usually use the array () function to create an array. The prototype of array () is:
Array (data = NA, dim = length (data), dimnames = NULL)
Where: data given array elements, by default is the dimension that NA;dim uses to specify the array, by default is an one-dimensional array; dimnames sets the name of each dimension, which must be a list, and there is no name by default.
For example, create an array of two 3x3 matrices, each with three rows and three columns.
# Create two vectors of different lengths.vector1
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.