Skip to content
Prev 180877 / 398525 Next

exists function on list objects gives always a FALSE

On 5/19/2009 12:07 PM, ?rout?k wrote:
There is no variable with name "SmoothData$span", there is an element of 
SmoothData with name "span".

To test for that, the safest test is probably

"span" %in% names(SmoothData)

but a common convention is to use

is.null(SmoothData$span)

because NULL elements are rare in lists.

Duncan Murdoch