R and googleVis - possible to make a "motion map"? - r

I am typically using R to do statistical analysis, and rather new to the data visualization capabilities. I'm trying to figure out if there is some way to marry the motion chart package gvisMotionChart with the mapping package, gvisGeoMap. I'd like to display a video of events over time, appearing on a map on their date of occurrence at lat/lon coordinates and then fading out. Anyone know if it's possible to do this? Any additional concerns if I have over 50,000 records (daily over 5 years) that I want to feed in to be displayed?
Please note that I do not have to use the gvis packages--I am just using these to motivate the idea. If there are other dynamic mapping packages available in R that will just draw on a shapefile and my event records, all the better.
Thanks!

Related

How to turn a spatial plot in R into an ArcGIS layer

So I hope I can clearly communicate my issue. Since I'm fairly new to R and ArcGIS I may miss some obvious things.
Basically, I'm using R to process spatial data to make a canopy height model and detect tree tops. That parts fine. I then make a watershed segment plot using forestTools package, and visually it looks great, but how do I export that as a file I can add into ArcGIS?
I'll copy some of the code that goes into what I'm discussing.
Basically, I just followed this guide's supplemental material to get the tree detection https://www.degruyter.com/document/doi/10.1515/geo-2020-0290/html?lang=en.
With that done, I then used the forestTools package to creat an interesting segmentation polygon grid on the map. https://www.rdocumentation.org/packages/ForestTools/versions/0.2.5/topics/mcws
This is quickly the plotting code to get visualized what I want.
[1]: https://i.stack.imgur.com/7Y0EF.png
This is what the map looks like with those plotted.
[2]: https://i.stack.imgur.com/Kdfl6.png
The layer that I want to bring solo to ArcGIS is that last plot the mcws one. I'll show a pic of that as well here.
[3]: https://i.stack.imgur.com/3PKfk.png
Is there a way that I can export that as a .shp or .tif?
Any help would be wonderful and much appreciated!
Nvmd I figured it out.
What you have to do is use the Raster package to export a shapefile.
raster::shapefile(site2_ttops,"Products/site2plot_ttops.shp")

How to stack a timeline/timeline events/and graphs in R

I want to create a timeline to show all the results of one of my studies. I just want to display a timeline, event by group, and line charts of some data I obtained.
I've tried doing it in illustrator/photoshop but it's just time consuming and not what I aiming for.
Here is the thing I've tried in illustrator, just to show you the type of diagram I'm aiming for:
So the figure I want to be able to do have this structure:
Timeline
Timeline events grouped by type
Line charts of my data
and so on...
Have you some suggestion to do it in R? Maybe a package? Or another tool?

Working with Dask, Xarray, Holoviews, Bokeh Datasets

Currently have very large xarray dataset with 7 data variables, each with shape of about 60-80k (x,y) values as well as 4 years (give or take) of time data. Im working on creating a UI that will display 3 maps, 1 main map and 2 maps shown below of a selected AOI, as well as a scatter plot, a time-series curve and a scatter matrix. I wan't this all to be fully interactive meaning updating all plots simultaneously with dropdowns selecting data variables and time-sliders etc.The issue i'm currently having is with memory and render time.
I'm wondering if anyone has done anything similar to this and what the best way to go about doing something like this while being efficient with memory etc.
xrviz does interactive 2d visualisation and extraction for xarray data (based on panel/holoviz). Please try it out and help us to improve it - it is still a work in progress.

Extracting charts from Socrata as you would a dataset

I need some help with extracting charts as you would a dataset and though the visualizations appear to be saved in the catalog as assets, I have not been able to find a way to pull the visualization out. I need to do this for at least 100 charts (all with different formatting) and it's looking like the only way I will be able to do this is to pull the dataset for each chart, recreate the chart in R and hopefully export it into excel (if that's even a thing).

SVGAnnotation to create tool tips for each value in R heatmaps

I'd like to create a heat map in R that I want to use on a website. I stumbled upon the SVGAnnotation package which seems to be very nice to process SVG graphics in R to make them more interactive. First, I was planning to add tool tips for each cell in the heatmap - if the user hovers over the cell, the value of this cell should pop up. However, I am fighting with SVGAnnotation for more than 3 hours now, reading and trying things, and I can't get it to work.
I would appreciate any help on the SVGAnnotation tool tip function. But I would also very much appreciate alternatives to SVGAnnotation to add some activity to my R SVG heatmap.
So, what I have got so far looks like this:
library(SVGAnnotation)
data(mtcars)
cars <- as.matrix(mtcars)
map <- svgPlot(heatmap(cars))
addToolTips(map, ...) # problem
saveXML(map, "cars.svg")
My problem is the addToolTips function itself, I guess. Intuitively, I would simply insert the data matrix, i.e., cars, but this does not work and R gets stuck (it's calculating, but doesn't return anything, I waited 50 minutes)
EDIT:
After some more online research, I found a good example of what I want to achieve: http://online.wsj.com/article/SB125993225142676615.html#articleTabs=interactive
This heat map looks really great, and the interactive features (tool tips) work very well. I am wondering how they did that. To me, it looks like the graphic was done in R using the ggplot package.
I wrote a command line tool that can do exactly that if you are still interested to add tool tips to your heat map. It runs in Windows/Linux/MacOS terminals. All you need as input is the heat map as svg file and the data table/matrix that you used as input to create your heat map as csv or other text file.

Resources