I have a dataset that has many columns which are NA or constant, and so I
remove them like so:
same - sapply(dataset, function(.col){
all(is.na(.col)) || all(.col[1L] == .col)
})
dataset - dataset[!same]
This works GREAT (thanks to the r-users list archive I found this)
however, then
Hello,
Inline.
Em 20-11-2012 22:03, Brian Feeny escreveu:
I have a dataset that has many columns which are NA or constant, and so I
remove them like so:
same - sapply(dataset, function(.col){
all(is.na(.col)) || all(.col[1L] == .col)
})
dataset - dataset[!same]
This works GREAT (thanks
2 matches
Mail list logo