Adding elements in a vector in R programming - append() method Last Updated : 10 May, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report append() method in R programming is used to append the different types of integer values into a vector in the last. Syntax: append(x, value, index(optional)) Return: Returns the new vector after appending given value. Example 1: Python3 x <- rep(1:5) # Using rep() method gfg <- append(x, 10) print(gfg) Output: [1] 1 2 3 4 5 10 Example 2: Python3 x <- rep(10:15) # Using rep() method gfg <- append(x, 1, 1) print(gfg) Output: [1] 10 1 11 12 13 14 15 Comment More infoAdvertise with us Next Article How to Create, Access, and Modify Vector Elements in R ? J jitender_1998 Follow Improve Article Tags : R Language Similar Reads Append Operation on Vectors in R Programming In this article, let us discuss different methods to concatenate/append values to a vector in R Programming Language. Append method in RVectors in the R Programming Language is a basic objects consisting of sequences of homogeneous elements. vector can be integer, logical, double, character, comple 2 min read Assigning Vectors in R Programming Vectors are one of the most basic data structure in R. They contain data of same type. Vectors in R is equivalent to arrays in other programming languages. In R, array is a vector of one or more dimensions and every single object created is stored in the form of a vector. The members of a vector are 5 min read How to Create, Access, and Modify Vector Elements in R ? In this article, we are going how to create, modify, and access vectors in vector elements in the R Programming Language. Vector is a one-dimensional data structure that holds multiple data type elements. Creating a vectorIt can be done in these ways: Using c() function.Using: operator.Using the seq 5 min read Adding an element to a call object in R In R Programming Language a call object represents an unevaluated function call. This type of object is a language construct that captures the function name and its arguments in a way that can be manipulated programmatically before actually executing the function. Call objects are typically used in 3 min read Add Leading Zeros to the Elements of a Vector in R Programming - Using paste0() and sprintf() Function paste0() and sprintf() functions in R Language can also be used to add leading zeros to each element of a vector passed to it as argument. Syntax: paste0("0", vec) or sprintf("%0d", vec)Parameters: paste0: It will add zeros to vector sprintf: To format a vector(adding zeros) vec: Original vector da 1 min read Applying a Function over an Object in R Programming - sapply() Function sapply() function in R Language takes list, vector or data frame as input and gives output in vector or matrix. It is useful for operations on list objects and returns a list object of same length of original set. Syntax: sapply(X, FUN) Parameters: X: A vector or an object FUN: Function applied to e 1 min read Like