hi guys, How do you check if variable is initialized/created, tried : is.nan(xxx) is.null(xxx) is.na(xxx) exists(xxx) all of them return : Error: object "xxx" not found I need true/false result ? thanx
is.variable ? is.initialized ?
4 messages · myshare, Rolf Turner
On 15/05/2009, at 11:19 AM, myshare wrote:
hi guys, How do you check if variable is initialized/created, tried : is.nan(xxx) is.null(xxx) is.na(xxx) exists(xxx) all of them return : Error: object "xxx" not found I need true/false result ?
exists("xxx") # Note the quote marks; requires the variable name as a
string.
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
thanx, I forgot something how then do you check if u have something like this :
exists("xxx$array")
this does not seem to work !! ;\
On Thu, May 14, 2009 at 11:26 PM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
On 15/05/2009, at 11:19 AM, myshare wrote:
hi guys, How do you check if variable is initialized/created, tried : is.nan(xxx) is.null(xxx) is.na(xxx) exists(xxx) all of them return : Error: object "xxx" not found I need true/false result ?
exists("xxx") # Note the quote marks; requires the variable name as a
string.
? ? ? ?cheers,
? ? ? ? ? ? ? ?Rolf Turner
######################################################################
Attention:This e-mail message is privileged and confidential. If you are not
theintended recipient please delete the message and notify the sender.Any
views or opinions presented are solely those of the author.
This e-mail has been scanned and cleared by
MailMarshalwww.marshalsoftware.com
######################################################################
On 15/05/2009, at 11:34 AM, myshare wrote:
thanx, I forgot something how then do you check if u have something
like this :
exists("xxx$array")
this does not seem to work !!
Of course not.
I don't think what you want is built in. But you can easily
cobble something together:
!is.na(match("array",names(xxx)))
will do it, I think. (Not tested.)
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}