[R] Package sqldf in R and dates manipulation

Mangalani Peter Makananisa pmakananisa at sars.gov.za
Fri Aug 11 15:21:35 CEST 2017


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]]



More information about the R-help mailing list