Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

function
r
communitycreator

What is the c() function in R?

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

The c() function in R is used to combine or concatenate its argument.

Syntax

c(…)

Parameter value

The c() function takes a parameter value , which represents the concatenated objects.

Return value

The c() function returns an expression or vector with an appropriate mode.

Example

a <- c(1, 2, 3)
b <- c(4, 5, 6)
mystring <- c(a, b)
mystring
Implementing the c() function

Explanation

  • Lines 1 and 2: We take three values and concatenate them.
  • Line 5: We use the c() function to concatenate the values in the objects a and b.

RELATED TAGS

function
r
communitycreator

CONTRIBUTOR

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring