How to get a subset with a date such as Date=11/03/2013 HE=02*?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get a subset with a date such as Date=11/03/2013 HE=02*?

jcrosbie
I'm having a problem working with daylight savings dates in R.

I'm downloading data in two formats.

Format One Col 1: a date such as "11/03/2013" col 2: Hour ending = 02*
Col1<-c("11/02/2008*", "11/02/2008", "11/02/2008", "11/02/2008")
Col1<-c("02*", "02", "03", "04")

Another data set is something like this: "11/03/2013 02*"
Col1<-c("11/02/2008 02*", "11/02/2008 02", "11/02/2008 03", "11/02/2008 04")

These data frames are very big and over multiple years with multiple values for each hour ending.

I'm trying to build subsets, filter, merge tables, lookup values with dates like these. How do I go about working with the "02*"?
Reply | Threaded
Open this post in threaded view
|

Re: How to get a subset with a date such as Date=11/03/2013 HE=02*?

Jeff Newmiller
Please read the Posting Guide. One of the suggestions given there is to provide a reproducible example... a sample of data is a good start.

You say this is related to daylight savings time in the subject line, but I don't see how that relates in your description. Perhaps you should provide a sample of data near the autumn time transition. Please use dput to generate R code that we can load your sample data easily.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<[hidden email]>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.

On March 24, 2014 3:35:44 PM PDT, jcrosbie <[hidden email]> wrote:

>I'm having a problem working with daylight savings dates in R.
>
>I'm downloading data in two formats.
>
>Format One Col 1: a date such as "11/03/2013" col 2: Hour ending = 02*
>Col1<-c("11/02/2008*", "11/02/2008", "11/02/2008", "11/02/2008")
>Col1<-c("02*", "02", "03", "04")
>
>Another data set is something like this: "11/03/2013 02*"
>Col1<-c("11/02/2008 02*", "11/02/2008 02", "11/02/2008 03", "11/02/2008
>04")
>
>These data frames are very big and over multiple years with multiple
>values
>for each hour ending.
>
>I'm trying to build subsets, filter, merge tables, lookup values with
>dates
>like these. How do I go about working with the "02*"?
>
>
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/How-to-get-a-subset-with-a-date-such-as-Date-11-03-2013-HE-02-tp4687488.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>[hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How to get a subset with a date such as Date=11/03/2013 HE=02*?

David Winsemius
In reply to this post by jcrosbie

On Mar 24, 2014, at 3:35 PM, jcrosbie wrote:

> I'm having a problem working with daylight savings dates in R.
>
> I'm downloading data in two formats.
>
> Format One Col 1: a date such as "11/03/2013" col 2: Hour ending = 02*
> Col1<-c("11/02/2008*", "11/02/2008", "11/02/2008", "11/02/2008")
> Col1<-c("02*", "02", "03", "04")
>
> Another data set is something like this: "11/03/2013 02*"
> Col1<-c("11/02/2008 02*", "11/02/2008 02", "11/02/2008 03", "11/02/2008 04")
>
> These data frames are very big and over multiple years with multiple values
> for each hour ending.
>
> I'm trying to build subsets, filter, merge tables, lookup values with dates
> like these. How do I go about working with the "02*"?
>

If you are adding those asterisks to that example (as I suspect)  then you are just creating problems in understanding what is really in your data. Instead post output from dput(dat) for a section of an object named 'dat'.


> View this message in context: http://r.789695.n4.nabble.com/How-to-get-a-subset-with-a-date-such-as-Date-11-03-2013-HE-02-tp4687488.html
> Sent from the R help mailing list archive at Nabble.com.

______________________________________________
[hidden email] 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.

--
David Winsemius
Alameda, CA, USA

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How to get a subset with a date such as Date=11/03/2013 HE=02*?

jcrosbie
Sorry I thought I was being clear.

These is how the time values in columns are downloaded from online (http://ets.aeso.ca/). When there is an extra hour in the date there are two hour ending twos in the that day (HE02 and HE02*). I did not create the data this way.

What is a good way of dealing with data in this format?  

 
Col1<-c("11/02/2008", "11/02/2008", "11/02/2008", "11/02/2008")
Col2<-c("02*", "02", "03", "04")
Col3SomeMadeupnumbers<-seq(1, 4, by=1)
df1 = data.frame(Col1, Col2,Col3SomeMadeupnumbers)


Col1<-c("11/02/2008 02*", "11/02/2008 02", "11/02/2008 03", "11/02/2008 04")
df2 = data.frame(Col1, Col3SomeMadeupnumbers)


Also, Nov. 2, 2008 02 is when there was a time change.




David Winsemius wrote
On Mar 24, 2014, at 3:35 PM, jcrosbie wrote:

> I'm having a problem working with daylight savings dates in R.
>
> I'm downloading data in two formats.
>
> Format One Col 1: a date such as "11/03/2013" col 2: Hour ending = 02*
> Col1<-c("11/02/2008*", "11/02/2008", "11/02/2008", "11/02/2008")
> Col1<-c("02*", "02", "03", "04")
>
> Another data set is something like this: "11/03/2013 02*"
> Col1<-c("11/02/2008 02*", "11/02/2008 02", "11/02/2008 03", "11/02/2008 04")
>
> These data frames are very big and over multiple years with multiple values
> for each hour ending.
>
> I'm trying to build subsets, filter, merge tables, lookup values with dates
> like these. How do I go about working with the "02*"?
>

If you are adding those asterisks to that example (as I suspect)  then you are just creating problems in understanding what is really in your data. Instead post output from dput(dat) for a section of an object named 'dat'.


> View this message in context: http://r.789695.n4.nabble.com/How-to-get-a-subset-with-a-date-such-as-Date-11-03-2013-HE-02-tp4687488.html
> Sent from the R help mailing list archive at Nabble.com.

______________________________________________
[hidden email] 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.

--
David Winsemius
Alameda, CA, USA

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How to get a subset with a date such as Date=11/03/2013 HE=02*?

gnicoulaud
This post has NOT been accepted by the mailing list yet.
In reply to this post by jcrosbie
CONTENTS DELETED
The author has deleted this message.