Top "Vector" questions

A vector is a single-dimensional array: it contains components that can be accessed using an integral index.

Counting the number of elements with the values of x in a vector

I have a vector of numbers: numbers <- c(4,23,4,23,5,43,54,56,657,67,67,435, 453,435,324,34,456,56,567,65,34,435) How can I have R count the number of times …

r vector count r-faq
How to find out if an item is present in a std::vector?

All I want to do is to check whether an element exists in the vector or not, so I can …

c++ vector std
What is the easiest way to initialize a std::vector with hardcoded elements?

I can create an array and initialize it like this: int a[] = {10, 20, 30}; How do I create a std::vector and …

c++ vector stl initialization
How do I erase an element from std::vector<> by index?

I have a std::vector<int>, and I want to delete the n'th element. How do I do …

c++ stl vector erase
How to print out the contents of a vector?

I want to print out the contents of a vector in C++, here is what I have: #include <iostream&…

c++ vector output stdvector cout
Test if a vector contains a given element

How to check if a vector contains a given value?

r vector r-faq
How to initialize a vector in C++

I want to initialize a vector like we do in case of an array. Example int vv[2] = {12, 43}; But when I …

c++ arrays vector declaration
Appending a vector to a vector

Assuming I have 2 standard vectors: vector<int> a; vector<int> b; Let's also say the both …

c++ stl vector
Append value to empty vector in R?

I'm trying to learn R and I can't figure out how to append to a list. If this were Python …

r list vector append
numpy matrix vector multiplication

When I multiply two numpy arrays of sizes (n x n)*(n x 1), I get a matrix of size (n …

python arrays numpy vector matrix