Skip to content
Prev 312999 / 398503 Next

Trim

On 05-12-2012, at 11:46, Vasilchenko Aleksander wrote:

            
dat <-
+ structure(list(V1 = structure(c(2L, 3L, 1L, 2L, 3L, 4L, 5L, 6L,
+ 4L, 5L), .Label = c("2006-10", "2006-11", "2006-12", "2007-01",
+ "2007-02", "2007-03"), class = "factor"), V2 = c(NaN, NaN, 0.1577647,
+ NaN, NaN, NaN, NaN, 0.2956429, NaN, NaN)), .Names = c("V1", "V2"
+ ), class = "data.frame", row.names = c("1", "2", "3", "4", "5",
+ "6", "7", "8", "9", "10"))

library(zoo)
na.trim(dat)

Berend