The Wayback Machine - https://web.archive.org/web/20231216160025/https://www.geeksforgeeks.org/combine-arguments-into-a-vector-in-r-programming-c-function/
Open In App
Related Articles

Combine Arguments into a Vector in R Programming – c() Function

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

c() function in R Language is used to combine the arguments passed to it.

Syntax: c(…)

Parameters:
…: arguments to be combined

Example 1:




# R program to cumulative maxima
  
# Calling c() function
x <- c(1, 2, 3, 4)
x


Output:

[1] 1 2 3 4

Example 2:




# R program to cumulative maxima
  
# Calling c() function
x <- c("a", "b", "c", "d")
x


Output:

[1] "a" "b" "c" "d"
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 15 Jun, 2020
Like Article
Save Article
Previous
Next
Similar Reads