Re: Package sqldf in R and dates manipulation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Package sqldf in R and dates manipulation

Mangalani Peter Makananisa
Dear all,

I recently read the book " R data preperation and manipulation using sqldf package"  by Djoni Darmawikarta
However, I have a problem with manipulation of dates using this package, I do not get the expected results. Do I need to install some packages  to be able to subset the data by dates in sqldf?

I am not getting Djoni Darmawikarta email address.

Please see the practice data attached and advise,

Kind regards,

Mangalani Peter Makananisa (0005786)
South African Revenue Service (SARS)
Specialist: Statistical Support
TCEI_OR (Head Office)
Tell: +2712 422 7357, Cell: +2782 456 4669


product = read.csv('D:/Users/S1033067/Desktop/sqldf prac/sqlprac.csv', na.strings = '', header = T)
head(product)
library(sqldf)
sqldf()

# out-put

> sqldf("select * from product
+                 where (date(Launch_dt) >= date('01-01-2003'))
+      ")
[1] P_Code    P_Name    Launch_dt Price
<0 rows> (or 0-length row.names)
>

Please Note: This email and its contents are subject to our email legal notice which can be viewed at http://www.sars.gov.za/Pages/Email-disclaimer.aspx

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Package sqldf in R and dates manipulation

Gabor Grothendieck
See FAQ #4 on the sqldf github home page.

On Fri, Aug 11, 2017 at 9:21 AM, Mangalani Peter Makananisa
<[hidden email]> wrote:

> Dear all,
>
> I recently read the book " R data preperation and manipulation using sqldf package"  by Djoni Darmawikarta
> However, I have a problem with manipulation of dates using this package, I do not get the expected results. Do I need to install some packages  to be able to subset the data by dates in sqldf?
>
> I am not getting Djoni Darmawikarta email address.
>
> Please see the practice data attached and advise,
>
> Kind regards,
>
> Mangalani Peter Makananisa (0005786)
> South African Revenue Service (SARS)
> Specialist: Statistical Support
> TCEI_OR (Head Office)
> Tell: +2712 422 7357, Cell: +2782 456 4669
>
>
> product = read.csv('D:/Users/S1033067/Desktop/sqldf prac/sqlprac.csv', na.strings = '', header = T)
> head(product)
> library(sqldf)
> sqldf()
>
> # out-put
>
>> sqldf("select * from product
> +                 where (date(Launch_dt) >= date('01-01-2003'))
> +      ")
> [1] P_Code    P_Name    Launch_dt Price
> <0 rows> (or 0-length row.names)
>>
>
> Please Note: This email and its contents are subject to our email legal notice which can be viewed at http://www.sars.gov.za/Pages/Email-disclaimer.aspx
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.



--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Package sqldf in R and dates manipulation

Mangalani Peter Makananisa
Thank you very much for  the help you provided.

RH2.

-----Original Message-----
From: Gabor Grothendieck [mailto:[hidden email]]
Sent: 11 August 2017 05:49 PM
To: Mangalani Peter Makananisa
Cc: [hidden email]; Vito Ricci ([hidden email]); [hidden email]
Subject: Re: [R] Package sqldf in R and dates manipulation

See FAQ #4 on the sqldf github home page.

On Fri, Aug 11, 2017 at 9:21 AM, Mangalani Peter Makananisa <[hidden email]> wrote:

> Dear all,
>
> I recently read the book " R data preperation and manipulation using
> sqldf package"  by Djoni Darmawikarta However, I have a problem with manipulation of dates using this package, I do not get the expected results. Do I need to install some packages  to be able to subset the data by dates in sqldf?
>
> I am not getting Djoni Darmawikarta email address.
>
> Please see the practice data attached and advise,
>
> Kind regards,
>
> Mangalani Peter Makananisa (0005786)
> South African Revenue Service (SARS)
> Specialist: Statistical Support
> TCEI_OR (Head Office)
> Tell: +2712 422 7357, Cell: +2782 456 4669
>
>
> product = read.csv('D:/Users/S1033067/Desktop/sqldf prac/sqlprac.csv',
> na.strings = '', header = T)
> head(product)
> library(sqldf)
> sqldf()
>
> # out-put
>
>> sqldf("select * from product
> +                 where (date(Launch_dt) >= date('01-01-2003'))
> +      ")
> [1] P_Code    P_Name    Launch_dt Price
> <0 rows> (or 0-length row.names)
>>
>
> Please Note: This email and its contents are subject to our email
> legal notice which can be viewed at
> http://www.sars.gov.za/Pages/Email-disclaimer.aspx
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.



--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

Please Note: This email and its contents are subject to our email legal notice which can be viewed at http://www.sars.gov.za/Pages/Email-disclaimer.aspx

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Loading...