Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Give examples of “rbind()” and “cbind()” functions in r



Give examples of “rbind()” and “cbind()” functions in r..

Answer / Dharmendra Kumar Kannaujiya

In R, the `rbind()` function is used to bind or combine row-wise data from multiple vectors, matrices, or data frames. Here's an example of combining two data frames using `rbind()`:nn```Rn df1 <- data.frame(a = c(1, 2, 3), b = c('A', 'B', 'C'))n df2 <- data.frame(a = c(4, 5, 6), b = c('D', 'E', 'F'))n result <- rbind(df1, df2)n```nThe `cbind()` function in R binds or combines columns-wise data. Here's an example of combining two matrices using `cbind()`:nn```Rn mat1 <- matrix(c(1, 2, 3, 4), nrow = 2)n mat2 <- matrix(c(5, 6, 7, 8), nrow = 2)n result <- cbind(mat1, mat2)n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More R Programming Interview Questions

How will you convert a factor variable to numeric in r language?

0 Answers  


How will you create scatterplot matrices in r language?

1 Answers  


How data is aggregated in r?

1 Answers  


What is R lists?

1 Answers  


What are the tools for debugging in R?

1 Answers  


How many control statements are present in r?

1 Answers  


What is iPlots?

1 Answers  


What is the recycling of elements in a vector? Give an example.

1 Answers  


What is bytecode compilation?

1 Answers  


What is Preliminaries in R?

1 Answers  


What is the regular expression in R string manipulation?

1 Answers  


How would you create a scatterplot using ggplot2 package?

1 Answers  


Categories