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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

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

148


How can you verify if a given object “X” is a matrix data object?

118


Given a vector of numbers, how would you turn the values into scientific notation?

103