how to add element to a vector in r code example Example: r append to vector append(x, values, after = length(x))