On Wed, Nov 3, 2010 at 1:04 PM, ivo welch wrote:
> thanks, eric---I need a little more clarification. *yes, I write
> functions and then forget them. so I want them to be self-sufficient.
> I want to write functions that check all their arguments for
> validity.) For example,
>
> my.fn <- fun
thanks, eric---I need a little more clarification. *yes, I write
functions and then forget them. so I want them to be self-sufficient.
I want to write functions that check all their arguments for
validity.) For example,
my.fn <- function( mylist ) {
stop.if.not( is.defined(mylist) ) #
On Nov 3, 2010, at 3:32 PM, ivo welch wrote:
thanks, barry and eric. I didn't do a good job---I did an awful job.
is.defined(never.before.seen$anything) ## if a list does not
exist, anything in it does not exist either
Except the $ function return NULL rather than an error and you alrea
alas, should R not come with an is.defined() function?
?exists
a variable may
never have been created, and this is different from a variable
existing but holding a NULL. this can be the case in the global
environment or in a data frame.
> is.null(never.before.seen)
Error: objected 'ne
thanks, barry and eric. I didn't do a good job---I did an awful job.
alas, should R not come with an is.defined() function? a variable may
never have been created, and this is different from a variable
existing but holding a NULL. this can be the case in the global
environment or in a data fram
On Wed, Nov 3, 2010 at 6:17 PM, ivo welch wrote:
> yikes. this is all my fault. it was the first thing that I ever
> defined when I started using R.
>
> is.defined <- function(name) exists(as.character(substitute(name)))
>
> I presume there is something much better...
You didn't do a good jo
the room,
the thing itself have purpose? Or do we, what's the word... imbue it."
- Jubal Early, Firefly
From:
ivo welch
To:
Erik Iverson
Cc:
r-help
Date:
11/03/2010 02:20 PM
Subject:
Re: [R] programming questions
Sent by:
r-help-boun...@r-project.org
yikes. this is all my
yikes. this is all my fault. it was the first thing that I ever
defined when I started using R.
is.defined <- function(name) exists(as.character(substitute(name)))
I presume there is something much better...
/iaw
On Wed, Nov 3, 2010 at 2:12 PM, Erik Iverson wrote:
>
>
> ivo welch wrote:
On 03/11/2010 2:05 PM, ivo welch wrote:
quick programming questions. I want to "turn on" more errors. there
are two traps I occasionally fall into.
* I wonder why R thinks that a variable is always defined in a data frame.
> is.defined(d)
[1] FALSE
> d= data.frame( x=1:5,
ivo welch wrote:
quick programming questions. I want to "turn on" more errors. there
are two traps I occasionally fall into.
* I wonder why R thinks that a variable is always defined in a data frame.
> is.defined(d)
[1] FALSE
> d= data.frame( x=1:5, y=1:5 )
> is.defined(
quick programming questions. I want to "turn on" more errors. there
are two traps I occasionally fall into.
* I wonder why R thinks that a variable is always defined in a data frame.
> is.defined(d)
[1] FALSE
> d= data.frame( x=1:5, y=1:5 )
> is.defined(d$z)
[1] TRUE
11 matches
Mail list logo