[R] how to determine if a variable is already set?

Duncan Murdoch murdoch at stats.uwo.ca
Fri Sep 11 21:32:33 CEST 2009


On 9/11/2009 1:15 PM, carol white wrote:
> Hi,
> It might be a primitive question but how it is possible to determine if a variable is initialized in an environment? Suppose that we start a R session and wants to run a script which use the variable i. Which function could evaluate if i is already initialized or not and if not, then ask interactively the user to set it? This is to avoid the error message: object i is not found.

See ?exists.

Duncan Murdoch




More information about the R-help mailing list