- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to concatenate strings in R?
Concatenation can be done by using paste function in R.
Example
> paste("I", "Love", "R", sep=" ") [1] "I Love R"
If we want to specify characters between words then it can be done by using collapse argument as follows −
> x <- c("I", "Love", "R") > x [1] "I" "Love" "R" > paste(x, collapse="-") [1] "I-Love-R"
- Related Articles
- How to concatenate several strings in JavaScript?
- How to concatenate two strings in C#?
- How to concatenate two strings in Python?
- How to correctly concatenate strings in Kotlin?
- How to concatenate two strings in Golang?
- How to concatenate two strings using Java?
- Concatenate strings in Arduino
- Different ways to concatenate Strings in Java
- Concatenate Multiple Strings in Java.
- Concatenate 2 strings in ABAP without using CONCATENATE function
- C++ Program to Concatenate Two Strings
- How to concatenate multiple C++ strings on one line?
- The Optimum Method to Concatenate Strings in Java.
- C++ program to concatenate strings in reverse order
- Python program to concatenate Strings around K

Advertisements