![]() highs % filter(productivity %in% c(0, 1, 2)) In order to create the split bar chart we have to split the dataframe for what we want on top and bottom. ![]() Mutate(date = date(time), hour = hour(time), duration_minutes = duration/60) %>% Let’s try recreating the time by hour chart.Ĭreating a split bar chart can be tricky with GGPlot2 - thanks to rnotr for their great tutorial: įirst format the API data #load from saved file With the API data we have productivity metrics so we can replicate more of the dashboard. My graph doesn’t look quite as nice, but the values are the same so it looks like we have accurate data. ![]() Labs(title="Top Categories", x = "Category", y = "Percentage") + Ggplot(aes(reorder(category, percentage), percentage)) + Mutate(percentage = (duration/total.duration)*100) %>% #use quo method (quote/un-quote) to filter for variable test.date valueįilter( UQ(date_col) = test.date) total.duration % With category and time data we should be able to recreate this graph. # $ domain : chr "Data Modeling & Analysis" "Browsers" "Writing" "Writing". # $ category: chr "Software Development" "Utilities" "Design & Composition" "Design & Composition". # $ title : chr "C:/Users/Will/Desktop/Personal Projects/PersonalSite - master - RStudio" "New Tab - Google Chrome" "Google Docs - Google Chrome" "Untitled document - Google Docs - Google Chrome". # $ activity: chr "rstudio" "newtab" "/#document" "/#document". Names(archive.data) <- c("time", "activity","title", "category","domain", "duration") archive.data <- read.csv("./data/rescuetime-activity-history.csv", stringsAsFactors = FALSE, header=FALSE) ![]() From here, getting the data into R is the same process you would use for any other CSV file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |