GME

Geospatial Modelling Environment

paste

This function is used within other command text to construct strings from a variety of components

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"


Messages

Please consider making a purchase to support the continued development of these tools  Read more...

An apology for failing to respond to correspondence in recent months  Read more...

Tips on how to use this interface efficiently  Read more...

Sign up for the newsletter if you wish to receive notification of updates, new functionality, bug fixes, and other related news

Links

Open Source GIS

Copyright © 2001-2010 Hawthorne L. Beyer, Spatial Ecology LLC