Here is some sample code to generate a random walk, create a line plot, and layer in the animation. I love how it's simple to layer within the #ggplot2 framework.
(3/n) Here is the resulting plot! using the `transition_reveal()` it keeps the previous points on the graph, but it is highly configurable. For example, I could use `transition_time()` or `transition_state()` to only show the point being added.
(4/n) I initially had some trouble getting the gif to render, so I added the gifski library based on this stack overflow post; stackoverflow.com/questions/5898…
(5/n) I also had some trouble using with geom_line for the first time, as my previous forays with gganimate used geom_point without issue. I was able to address based on this GitHub issue to add the transformr library
(1/n) All about Shiny. My go to approach for building shiny apps is finding an example I like, going to the github to review the code, and retrofitting it for my use case (w/ credits!).
(2/n) I learned this approach via an online course where we deployed models via Shiny to show performance. It was daunting at first and my first foray into building an application.
If you are just getting into Shiny and feel overwhelmed, you've got this & keep at it.
(3/n) Version control & Peer review: Something I like about code based dashboards (vs. low/no code solutions) is that it version control becomes possible via git, and dashboards that require complicated calculations are more visible/transparent in a single script.
(1/n) I'm sure that there are tons of #DataViz & #rmarkdown tips & tricks out there. So in this thread, I would just like to share a bit of my coding adventures. 🤓💻
(2/n) Before discovering the wonderfulness of ggplot2, my figures were confined to the "limits" of MS Excel. While it is definitely possible to create coherent plots in Excel, it does get kinda clunky when you have more complex data. And what about overlaying my plots?? 🤨
(3/n) Cue ggplot2! Its super intuitive, customizable & compatible with tons of extensions that "enhances" one's plotting capabilities.
(1/n) Why do we do literature reviews? Apart from it forming a PhD chapter (as most of us would kinda have to do), literature reviews give us an overview of our research topic(s). Talking about the INs and OUTs of Topic XYZ~ 📚📖📑
@twisteddoodles (2/n) Well, instead of manually downloading and trawling through every single paper (really??), did you know that you can use R for literature reviews?
(1/n) It's time for some dung beetle "juicy-ness" again~
My first attempt at using R for spatial data is to map the occurrences of dung beetles in Sabah, Malaysia and Singapore!
(2/n) If you would like some background as to what motivated this, check out our cool GBIF-funded project here! 😎gbif.org/project/BIFA6_…
(3/n) My ambitious goal was to make the occurrence maps interactive! With some googling, I found many resources using Leaflet, an open-source JavaScript library for interactive mapping. Best of all, the leaflet R package is super versatile and allows for easy map customizability.
(1/n) Today's topic is working with spatial data in R! TBH I'm pretty new to this and my spatial data experience has mostly been with using GIS software like ArcGIS, QGIS.
It was only this year where I really started dabbling in using R for spatial data mapping. 🗺️📌
What really caught my attention is the history of spatial analysis in R and that R's capabilities in handling spatial data is increasingly improving! 🤩
(3/n) What I really like about using R for spatial data is that its a single environment for data processing, analysing and mapping
I can also use other packages for data manipulation etc before translating them into spatial objects with more specific spatial packages. 🤓