Description
This function is designed to be embedded within other command text. It creates new strings (text) based on a variety of inputs you define. Those inputs can be other strings (in quotes), numbers (in quotes or not in quotes), index variables from a for loop, or variables that you have defined.
The optional 'sep' argument allows you to define the separator to use between the components. By default this is nothing, but if you are constructing a comma delimited list you would chance this to sep="," for instance.
This paste function is very similar to the paste function in R.
Syntax
paste(..., [sep])
| ... | a comma delimited list of components from which the new string is constructed |
Example
wd <- "C:\data\"
paste(wd, "image", i, ".img")
Assuming this paste function is embedded in a command occurring within a for(i in 1:3){...} loop, and the 'wd' variable has previously been defined, the following strings would result in each of the three loops:
"C:\data\image1.img"
"C:\data\image2.img"
"C:\data\image3.img"