![]() In the example below, we create a vector variable called. To create a vector of integers, pass the integers to the c () function in the order you want them in the vector. When we execute the above code, it produces the following result. ![]() Create vector with elements from 5 to 9 incrementing by 0.4. They are logical, integer, double, complex, character and raw. We can create a vector with a sequence of numbers by using − if the sequence of numbers needs to have only the difference of 1, otherwise seq function can be used. To combine the list of items to a vector, use the c() function and separate the items by a comma. R Vectors - Vectors are the most basic R data objects and there are six types of atomic vectors. Creating a numeric vector is the first step towards learning R programming and there are many ways to do that but if we want to generate a sequence of number then it is a bit different thing, not totally different. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |