Žroutík wrote: > >> SmoothData <- list(exists=TRUE, span=0.001) >> SmoothData >> > $exists > [1] TRUE > > $span > [1] 0.001 > > >> exists("SmoothData") >> > TRUE > > >> exists("SmoothData$span") >> > FALSE > >
'SmoothData$span' = 'foo' exists("SmoothData$span") # TRUE >> exists("SmoothData[[2]]") >> 'SmoothData[[2]]' = 'bar' exists("SmoothData[[2]]") # TRUE the problem in your case is that you have an object named 'SmoothData' with a nested component named 'span', but you're testing for the existence of an object named 'SmoothData$span'. as shown in a recent post, one attempt to do your task would be exists('SmoothData') && 'span' %in% names(SmoothData) # TRUE vQ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.