Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
13 views
in R Programming by (7.3k points)
Can anyone tell me what is c in R programming?

2 Answers

0 votes
by (41.4k points)

The c function in R programming stands for 'combine.' This function is used to get the output by giving parameters inside the function. The parameters are of the format c(row, column). With the c function, you can extract data in three ways:

 

  • To extract rows, use c(row, )
  • To extract columns, use c( , column)
  • To extract rows and columns together, use c(row, column)

 

Here, you give row and column numbers of the dataset that you are using, and the function will return a vector.

 

Also, the c() function can be used to combine two vectors.

0 votes
by (1.3k points)

c is a generic function available within the R programming library, it is used for combining  values into vectors. It permits the user to combine two or more than two vectors in a single vector

Implementation:

If there exist two vector let’s say A and B

A <- c(1, 2, 3)

B <- c(6, 23, 4)

Combined_result <- c(A, B)

# output = 1, 2, 3,6, 23, 4

31k questions

32.9k answers

507 comments

693 users

...