Top "Vector" questions

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

check if a std::vector contains a certain object?

Is there something in <algorithm> which allows you to check if a std:: container contains something? Or, a …

c++ vector
R memory management / cannot allocate vector of size n Mb

I am running into issues trying to use large objects in R. For example: > memory.limit(4000) > a = matrix(…

r matrix vector memory-management r-faq
Convert data.frame column to a vector?

I have a dataframe such as: a1 = c(1, 2, 3, 4, 5) a2 = c(6, 7, 8, 9, 10) a3 = c(11, 12, 13, 14, 15) aframe = data.frame(a1, a2, a3) I tried …

r dataframe vector type-conversion
What's the most efficient way to erase duplicates and sort a vector?

I need to take a C++ vector with potentially a lot of elements, erase duplicates, and sort it. I currently …

c++ sorting vector stl duplicates
How to convert vector to array

How do I convert a std::vector<double> to a double array[]?

c++ arrays vector
Is it more efficient to copy a vector by reserving and copying, or by creating and swapping?

I am trying to efficiently make a copy of a vector. I see two possible approaches: std::vector<int&…

c++ algorithm vector stl
How to navigate through a vector using iterators? (C++)

The goal is to access the "nth" element of a vector of strings instead of the [] operator or the "at" …

c++ iterator vector
Best way to extract a subvector from a vector?

Suppose I have a std::vector (let's call it myVec) of size N. What's the simplest way to construct a …

c++ stl vector range
How to access the last value in a vector?

Suppose I have a vector that is nested in a dataframe one or two levels. Is there a quick and …

r dataframe vector