Dear R users, I'd like to remove some descriptions when I use "filter".> filter(1:10, rep(1, 3))Time Series: Start = 1 End = 10 Frequency = 1 [1] NA 6 9 12 15 18 21 24 27 NA That is, I want only this [1] NA 6 9 12 15 18 21 24 27 NA Thank you in advance. Kathie -- View this message in context: http://r.789695.n4.nabble.com/remove-descriptions-from-output-tp4634723.html Sent from the R help mailing list archive at Nabble.com.
Dear Kathie, Try c(filter(1:10, rep(1, 3))) Best Ozgur -- View this message in context: http://r.789695.n4.nabble.com/remove-descriptions-from-output-tp4634723p4634727.html Sent from the R help mailing list archive at Nabble.com.
Hi, You could also use rollapply () from zoo library(zoo) ?t2<-as.numeric(rollapply(1:10,3,sum)) [1]? 6? 9 12 15 18 21 24 27 t1<-c(filter(1:10, rep(1, 3))) t1<-t1[!is.na(t1)] ?identical(t1,t2) [1] TRUE A.K. ----- Original Message ----- From: ?zg?r Asar <oasar at metu.edu.tr> To: r-help at r-project.org Cc: Sent: Thursday, June 28, 2012 6:31 AM Subject: Re: [R] remove descriptions from output Dear Kathie, Try c(filter(1:10, rep(1, 3))) Best Ozgur -- View this message in context: http://r.789695.n4.nabble.com/remove-descriptions-from-output-tp4634723p4634727.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help at 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.
On 28/06/12 22:24, Kathie wrote:> Dear R users, > > I'd like to remove some descriptions when I use "filter". > >> filter(1:10, rep(1, 3)) > Time Series: > Start = 1 > End = 10 > Frequency = 1 > [1] NA 6 9 12 15 18 21 24 27 NA > > > That is, I want only this > > [1] NA 6 9 12 15 18 21 24 27 NA > > Thank you in advance.Use as.vector() on the output of filter. cheers, Rolf Turner