Skip to content
Prev 75458 / 398503 Next

coercing created variables into a new data frame using na.omit()

On Fri, 12 Aug 2005, Kjetil Brinchmann Halvorsen wrote:

            
No, it's just a sketch of a style.
I intended that the changed object be returned: so for example

test <- with(test, {test$c <- 1:5; test})

does work.  What I really meant to write (and had tested) could be 
sketched as

value <- with(data.frame1, {
# commands to create value
})
data.frame1$new.variable <- value
data.frame3 <- na.omit(data.frame1)

but cut-and-paste got two lines out of order.