March 2018
Beginner to intermediate
570 pages
13h 42m
English
Following the procedures in the previous section, let’s convert the thedate column from UNIX time to regular-people time using the anytime package. For this we use the mutate function, as shown in the following code:
> library(anytime)> tracks %<>% mutate(thedate=anytime(thedate))> tracks# A tibble: 138,135 x 5 thedate trackname artist album mbid <dttm> <chr> <chr> <chr> <chr> 1 2016-11-25 00:59:07 A Perfect Match A*Teens Greatest Hits 69d9cb53-5b8f-41b0-ac~ 2 2016-11-24 17:01:42 Mamma Mia A*Teens Greatest Hits 69d9cb53-5b8f-41b0-ac~ 3 2016-11-23 15:30:58 Upside Down A*Teens Greatest Hits 69d9cb53-5b8f-41b0-ac~...# ... with 138,125 more rows
Now we can just that count of tracks I listened to in January of 2016, using ...