Re: [R] How to eliminate perticular date

From: jim holtman <jholtman_at_gmail.com>
Date: Sun, 11 May 2008 21:21:01 -0400

What you are getting back in 'feb_no_29' is a data frame which can not be used for indexing. Do 'str(feb_no_29)' and see what you set. What you probably want to do is to use 'which' to find out which rows match the criteria and then delete them:

feb_29 <- which((Pooraka_data$Month == "2") & (Pooraka_data$Day == "29")) data_without_2_29 <- Pooraka_data[-feb_29,]

On Sun, May 11, 2008 at 8:54 PM, Roslina Zakaria <zroslina_at_yahoo.com> wrote:

> Hi R-expert,
> I try to eliminate 29 Feb but I got an error message below:
> feb_data1 <- Pooraka_data[Pooraka_data$Month=="2",]
> feb_28days <- feb_data1 [feb_data1$Day=="28",]
> feb_29days <- feb_data1 [feb_data1$Day=="29",]
> ## delete 29 Feb
> feb_no_29 <- feb_data1 [-(feb_29days),]
> feb_no_29 <- feb_data1 [-(feb_29days),]
> Error in xj[i] : invalid subscript type 'list'
> Thank you so much for your attention.
>
>
>
> ____________________________________________________________________________________
>
> [[elided Yahoo spam]]
>
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

	[[alternative HTML version deleted]]

______________________________________________
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.
Received on Mon 12 May 2008 - 01:31:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 12 May 2008 - 04:30:37 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive