buildingwidgets
buildingwidgets copied to clipboard
shooting signatures from Peter Beshai
These could be used for lots of purposes outside of basketball https://gist.github.com/pbeshai/ffd0f9d84b4e8df27db2
+1 for this one. After September, I could try to help if you'd like
these are super cool, and so nice looking
@kferris10 and @Cat1796 I have sort of held off on these, since I didn't want to just copy the author's work for basketball. I'd love some help thinking of non-basketball use cases and then I could get much more motivated to write a htmlwidget
wrapper.
I imagine that sort of spatial or temporal data would work well. I'll try to think of a couple of ideas outside of sports today.
So this is a really dorky example with some data I found by googling "repeated measures data." Here's a description of the data that I didn't understand.
library(dplyr)
library(ggplot2)
x <- read.table("http://www.stat.ufl.edu/~winner/data/ecophys_rc.dat") %>%
setNames(c("location", "treatment", "plant_id", "co2_concentration", "co2_uptake_rate")) %>%
group_by(plant_id) %>%
mutate(time = 1:n()) %>%
ungroup()
x
Source: local data frame [84 x 6]
location treatment plant_id co2_concentration co2_uptake_rate time
1 1 1 1 95 16.0 1
2 1 1 1 175 30.4 2
3 1 1 1 250 34.8 3
4 1 1 1 350 37.2 4
5 1 1 1 500 35.3 5
6 1 1 1 675 39.2 6
7 1 1 1 1000 39.7 7
8 1 1 2 95 13.6 1
9 1 1 2 175 27.3 2
10 1 1 2 250 37.1 3
.. ... ... ... ... ... ...
Then what I think would be cool would be shooting signatures like this plot. If we ignore the fact that this doesn't look very nice and that I cheated by using CO2 concentration twice, what I think would be cool would be something with a little reactivity. I think that it would be possible to make the signature, then have something like a shiny input to toggle the selected plant ID.
x %>%
filter(plant_id == 1) %>%
qplot(time, co2_uptake_rate, data = ., geom = "line", group = plant_id,
colour = co2_concentration, size = co2_concentration)
At work, I often want to make a plot like this for 10 or 20 different people. As far as I'm aware, the easiest way to do this is through a Shiny app. But even that's kind of a pain and it's difficult to share with people if you don't want to post stuff online. This would be a nice solution. Even in the basketball example it would be great to just click a box and change the shooter.
Anyways, hope this makes some sense. And sorry I wrote a novel. I can put together some more examples if you're interested.
This is great. Thanks so much for the effort. I'm sold. I won't be able to work on it until next week, but would think could get it up and running in a very short amount of time.
Forgot to reply, but that sounds great. If you need some ideas for examples, let me know. I'm sure that I can find something.
I started working on this at https://github.com/timelyportfolio/shotsignR. By the end of the day, I hope it will be flexible enough to recreate your example.