Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Visualising “bigger data”
In the blog post Criminal goings-on in a random forest, we used supervised machine learning to see how well we could predict crime in London. We began by rendering and exploring some of the many facets of the recorded crime summary data at London borough-level .
There comes a point though where the many faces of the data require something more than a static visualisation. And there are alternative options. We can make “bigger data” visualisations more consumable and engaging. In this post we’ll go deeper into the original data with a more interactive and flexible approach.
Framing the questions
Suppose we want to explore the lower-level minor crime categories by borough. That would entail 1,024 mini visualisations. That’s a lot of scrolling. Or a dizzying set of Powerpoint slides.
Suppose too that we want to know which of these mini plots exhibits either the steepest increase or decrease over time. We may want to do this selectively by borough. Or by major crime category.
With a “trelliscope” approach, we can create a set of filterable and sortable panels wrapped in an engaging experience. And by anticipating the questions uppermost in the minds of the data’s ultimate consumers, we can create appropriate “cognostics” tailored to the task.
Play with the app
Play with the app full-screen, and see the code, here.
R toolkit
R packages and functions used.
Packages | Functions | |
---|---|---|
purrr | map[1]; set_names[1] | |
furrr | future_map2_dfr[1] | |
future | plan[1] | |
readr | read_csv[1]; read_lines[1] | |
dplyr | mutate[6]; filter[4]; group_by[3]; if_else[3]; tibble[3]; summarise[2]; arrange[1]; as_tibble[1]; desc[1]; select[1] | |
tidyr | nest[1]; unnest[1] | |
stringr | str_c[4]; fixed[1]; str_count[1]; str_detect[1]; str_remove[1]; str_remove_all[1] | |
lubridate | month[1]; year[1]; ymd[1] | |
tibble | enframe[1] | |
rebus | lookahead[3]; whole_word[2]; lookbehind[1]; one_or_more[1] | |
stats | coef[1] | |
base | library[8]; c[2]; function[2]; list[2]; sum[2]; conflicts[1]; cumsum[1]; max[1]; min[1]; months[1]; Negate[1]; search[1] | |
ggplot2 | element_text[3]; element_rect[2]; labs[2]; facet_wrap[1]; geom_line[1]; ggplot[1]; ggtitle[1]; theme[1] | |
trelliscopejs | cog[3]; map_cog[1]; map_plot[1]; trelliscope[1] | |
rbokeh | figure[1]; ly_lines[1]; ly_points[1]; theme_plot[1] | |
ggthemes | scale_colour_economist[1]; theme_economist[1] | |
kableExtra | kable[1]; kable_styling[1] |
The post Seeing the wood for the trees appeared first on thinkr.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.