How to use paste0) Function In R Language
In this approach to split the code over multiple lines with writing character string over multiple lines using the paste() function, the user just needs to call the paste function, which is an in-built function of the R language, and then needs to code which will split over multiples lines as the parameters of this function and further this will lead to the splitting of the code over multiple lines in R programming language.
paste0() function is used for concatenating vectors after converting to characters.
Syntax:
paste0(…, collapse = NULL)
Parameters:
- … : one or more R objects, to be converted to character vectors.
- collapse: an optional character string to separate the results. Not NA_character_.
Example: R program to split code over multiple lines
R
gfg <- paste0 ( "A " , "Computer Science " , "portal for " , "geeks" ) gfg |
Output:
[1] A Computer Science portal for geeks
Split Code Over Multiple Lines in R
In this article, we will discuss how to split code over multiple lines in R programming language.