Adding elements in a vector in R programming – append() method

method in R programming is used to append the different types of integer values into a vector in the last.**append()**

Syntax:`append(x, value, index(optional))`

Return:Returns the new vector after appending given value.

**Example 1:**

`x <` `-` `rep(` `1` `:` `5` `)` ` ` `# Using rep() method` `gfg <` `-` `append(x, ` `10` `)` ` ` `print` `(gfg)` |

**Output:**

[1] 1 2 3 4 5 10

**Example 2:**

`x <` `-` `rep(` `10` `:` `15` `)` ` ` `# Using rep() method` `gfg <` `-` `append(x, ` `1` `, ` `1` `)` ` ` `print` `(gfg)` |

**Output:**

[1] 10 1 11 12 13 14 15

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.