The c() function in R is used for combining values to vector or list. The c stands for combine or concatenate.

The following method shows how you can do it with syntax.

Method: Use c() Function

c(value1,value2,value3,...)

The following example shows how to use c() function in R.

Use c() Function

Let’s create vector using c() function in R:

# Create vector
vect <- c(12,23.34,45,56,67,78,89,90)

# Show vector
print(vect)

Output:

[1] 12.00 23.34 45.00 56.00 67.00 78.00 89.00 90.00

The output shows values of vector that we combine using c() function.