Multi-functional Shiny App Using Maps and Graphs - r

I am trying to develop a Shiny App in R for a project that I am working on in order to more efficiently share data and display results of this data for a large working group. I have a spreadsheet with 75 trailheads (points) that contain information related to latitude, longitude, and visitor usage data based on month and year starting in 2016. What I am hoping to do is develop an app that allows users to select all or multiple trailheads and either display the count numbers based on a selected month of a year or a year and have those results be displayed on a map as points based on density as well as a graphical plot that will display the results of the trailheads on a bar graph or something similar that users can look at the geographical dispersion of usage as well as usage trends.
I am have gone through many examples but cannot seem to find any that would allow all this functionality. If anyone can point me in the right direction, as far as locating code, that would be greatly appreciated.

Related

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).

Power View - Tables with columns of the similar data

Apologies in advance if my question is obvious but I'm new to this and having spent days searching and experimenting I cannot achieve the result I'm after.
I have a big table of data that I want to plot some graphs for, namely stacked columns and then filter these using other criteria such as date. I came across Power View and have been learning to use it hoping it will let me produce the reports I'm after rather than standard Excel graphs which are very clunky.
An example of the sort of data my tables contains is as follows although I have a lot of other columns and about 20 of the similar metric columns:
]
And this is the sort of graph I want to plot:
]
Where the red sections correspond to "R0" values, the orange "R1" and the green "R2" - they're essentially a rating; poor, ok and good. I can plot a single metric versus the items column with the stacked bar fine but cannot find a way to plot the metrics long the x axis for say a given item or sum of all items.
I've created measures using CALCULATE to filter by the rating but when I try and plot these my only option in power view is a clustered column graph where the x axis is the rating and the legend is the metrics.
I also created another small table with a single column of R0, R1 and R2 but can only link that to one metric column whereas I need it to link to all of them.
I think it's potentially a many to many mapping issue and have found a lot of links covering bridge tables and the magic CALCULATE function.
However as I'm trying to map values in a column to several other columns it doesn't seem to quite fit the many to many problem or if it does I can't see it.
I feel like what I'm after should be quite simple but I either end up with all my metric columns being made to show identical values or there's loads of cross filtering that I don't want. The "ratings" for each metric are essentially independent and I don't want to combine them in any way.
Any help is greatly appreciated and if my solution is in the links I've listed above then I'd really appreciate a bit of help with seeing it.
Thanks in advance

How do I plot two values against each other in tableau

I have two values I wish to plot against each other in tableau. They are two totals aggregated around the same date. I can get them to the point where they are plotted on a dual access against the date like so:
but any attempt to plot them against each other for correlation has come to nothing. I've tried simple conversion to scatterplot, using calculated fields, using a cross tab with subtitles and attempting to only plot the subtotals against each other all of which have failed. I could do it in Excel but have to do it in tableau.
I have consulted the official Tableau 9.0 guide, google and existing questions on Stack Overflow all to no avail. If I was doing this in BOXI, I could just select the columns and chart them. How do I do the equivalent visualisation in Tableau?
You aren't clear about what type of chart you want to make.
Do you want a scatter plot? If so, put one measure on the row shelf, the other measure on the column shelf, and one or more dimensions (such as your date) on the detail shelf to define how finely to aggregate the data. Check the aggregation functions you use (SUM, AVG) and the aggregation level for your date fields (YEAR, MONTH ...) as desired. You probably want to use the second block of date aggregations on the menu unless you want to group all January data together regardless of year.
If you want a connected scatter plot, set the mark type from automatic to line and move the date field from the detail to the path shelf. You might also then want to put the date on size, color or legend to visually show the direction of time on the line. You might need to change that field to attribute in some cases to avoid creating multiple lines.
Tableau is fantastic once you learn how it works, and get a strong understanding of how choices about treating fields as dimensions or measures, or discrete or continuous impacts the behavior. If you skim over those details, you can still make beautiful charts by following recipes, mimicking examples (and asking StackOverflow), but Tableau's behavior will seem mysterious and arbitrary.
If you take some time to learn the fundamentals about how Tableau works, it will repay your time investment. I recommend Joshua Milligan's book Learning Tableau for a good way to start, along with the training videos on the Tableau website.

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

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!

Resources