I am using sqldf library to return a data frame with distinct values and also only the max of the date column. The data frame looks like this
+------+----------+--------+-----------------+
| NAME | val1 | val2 | DATE |
+------+----------+--------+-----------------+
| A | 23.7228 | 0.5829 | 11/19/2014 8:17 |
| A | 23.7228 | 0.5829 | 11/12/2014 8:16 |
+------+----------+--------+-----------------+
When I try to run the below code to get the distinct values with max date
df <- sqldf("SELECT DISTINCT NAME, val1, val2, MAX(DATE) FROM Table")
I get this as the output.
+------+----------+--------+-----------------+
| NAME | val1 | val2 | MAX(DATE) |
+------+----------+--------+-----------------+
| A | 23.7228 | 0.5829 | 1416406625 |
+------+----------+--------+-----------------+
Please let me know how do I convert the last column, which is an integer to get back my datetime format.