On March 6, 2008 Steve Jobs announced the App Store, a platform where developers could sell software directly to customers without worrying about maintaining a distribution platform. For the many geeks like me who were obsessed with the iPhone, this news was electrifying.
That year, masses of geeks would drop their day jobs to become indy app developers. Many would fail, some would get rich and a few would change the world. Continue Reading
This is my first D3 visualization. You get a dropbox with a list of major metropolitan areas. When you select an item the data table and bar graph will adjust to show the population for the area.
datapointsr is an R package that makes it a little bit easier to QC and work on statistical summary tables. datapointsr acts as a wrapper for sqldf and reshape and it also puts statistical tables into a standard format(categories, variables, values). The idea is that it will be easier to build reusable functions later on if I can assume that data will be in this format.
I'm moving toward making this work more like the dplyr package with a emphasis on verbs.
You can install datapointsr from Github using the devtools package like this:
Here is an example of how to use datapointsr. First, make a dataset to work on. Below I summarized the
quakes_summary <- quakes %>% group_by(stations) %>% summarise(mag_mean = mean(mag), mag_sd = sd(mag), depth_mean = mean(depth), depth_sd = sd(depth)) quakes_summary %>% head()
stations mag_mean mag_sd depth_mean depth_sd <int> <dbl> <dbl> <dbl> <dbl> 1 10 4.230000 0.1894591 345.5000 199.3979 2 11 4.228571 0.1843048 338.2857 214.3564 3 12 4.196000 0.2091252 364.4000 201.9051 4 13 4.333333 0.2008316 416.2381 207.2462 5 14 4.276923 0.2019139 312.1282 214.2942 6 15 4.282353 0.1930153 313.4706 188.8933
To use datapointsr, figure out which variables will act as categories and which variables
will act as measure values. Since I grouped by
stations I can treat it as a category
while all the other columns look like measures; so I will use datapoints to make a long
quakes_summary %>% datapoints(1) %>% head()
stations Variable Value 1 10 mag_mean 4.230000 2 11 mag_mean 4.228571 3 12 mag_mean 4.196000 4 13 mag_mean 4.333333 5 14 mag_mean 4.276923 6 15 mag_mean 4.282353
This is the
datapoints format: categories followed by variable name and then the value
from the column. This makes it really easy to do an exact 1:1 match for QC.
filter_sql to look up values with SQL syntax:
quakes_summary %>% datapoints(1) %>% filter_sql("stations IN (10,43) AND Variable = 'mag_sd'")
stations Variable Value 1 10 mag_sd 0.1894591 2 43 mag_sd 0.2143223
There is also a
wide() function that can be used to switch back to wide format.
You can see the latest on DataPoints here.
In an effort to learn D3 more deeply I have started to create my own D3 based charting library based on the guidance that Mike Bostock offers in Towards Reusable Charts. I realize that there are already plenty of simple D3 based alternatives like Vega and Vega-Lite and I would probably still use these until I'm more confident with D3; but I want to move to a place where I can really build custom experiences for the web. Raw D3 is really the only way to do that.
You can follow this project on GitHub <- I need to find some time to work on this more, but I have a good pattern down I hope.