Marlorie Hughes - Dashboarding Like a Boss

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right hello my name is Mallory and I really love dashboards and I'm so excited to tell you guys all about them so I am a data scientist I work full time as a consultant for Amazon through a company called Annika I was previously at NPR and amplify education before that and we're going to talk about dashboards so I am kind of addicted to - words and every time I make a project I put all my analysis in a dashboard and my goal here is to inspire some of you to love dashboarding like I love dashboarding I know all of you might you know maybe not but it's kind of like a therapy that you can insert in between the pain of constant data manipulation and you get to make something pretty so here we go also this is a dashboard and I've got my slide deck in a dashboard and you'll see you can put dashboards in dashboards I haven't I mean dashboards all the way down you know alright so why bother so first of all they're pretty and organized so if you have a whole bunch of stuff like a whole bunch of plots and CSVs and let's say you have a set of slides and some other HTML output and you want to put this all this stuff together you should never email that stuff no one wants to look at CSV use and pngs in their email and things get lost and it's terrible and you forget the last status state of things and then somebody asks you for something and you have to go find the Pete you know the PNG that oh my god it's just terrible so this is a way that you can keep your stuff organized and pretty in so wait you know you can make things that aren't dashboards you can make our markdowns like regular notebooks but it's a pretty easy transition as you'll see to making it really pretty and you can convert between the different formats fairly easily so it's risk free and there are templates galore and by risk free I mean so unlike when you're trying a new modeling tool or a new package that manipulates data you have to know what you're doing and you have to check a lot of stuff to make sure that what you intended to do you actually achieved that's goal but with dashboarding like all you're doing is organizing your stuff and making it pretty so you can take someone's template and copy and paste the CSS that they wrote and you don't have to understand anything about it but did it make your dashboard prettier cool you can use it so it's a very fake it till you make it kind of thing you don't have to understand anything and like you just mess around and go oh okay that blew everything up or all that made like where's my output now so you really don't have to know what you're doing you're not gonna like mess up your actual analysis it's just like a fun like play space also - speaking of templates galore all of this is on my github everything all the tutorials within it so my main contribution here is not that I'm gonna be able to teach you a whole bunch of stuff right now and mostly like it trying to inspire you to bother to go to the github onion you can just take all the code and like put your own data in it and then there you go that's how it starts so I know this is a bit controversial but with dashboards you can have you know interactive stuff like with HTML so unlike in powerpoints or other still forms like PNG s in a dashboard you can have everything interactive like hover with like information that pops up and you can do so much more with an interact a single interactive plot than you can with a static one so yeah sorry Gigi but we'll get there and to redeem myself you get to use our so that's you know enough said and it's flexible and reproducible so just like with an hour markdown that you could supply arguments and then render the code you can do the same kind of thing here so for example if you had 30 different podcasts and you wanted to make a dashboard for each one of those podcasts you could write one dashboard script with some arguments and then have a little render function that run and I'll put a little loop around it and then you could just build render and publish 30 different dashboards with just a single template pretty awesome and best of all people will respect you so I have to say there's like nothing more satisfying in the world than when you went some Python fan boys that you've overheard talking about how R is dead see your dashboards and then ask you how you made it and you're like with our okay so let's get to it so I have created a stealth 12-step program to quit emailing plots and CSVs I can't get through all twelve steps today but I'll try to get you at least part of the way there and obviously I just wanted to make it twelve steps like could have made it some other number of steps like ten probably was easier I had to kind of work at it to get it into twelve but basically you have your basic layout actually making the dashboard layout is not hard that's the easiest there's so much information about that on the internet we're gonna be using flex dashboard as you'll see but and then there's tables interactive datasets interactive plots exporting your data and then how to deal with CSS CSS which mostly you'll copy-paste somebody else's CSS like all the CSS templates that I provided at the github and then your branding hosting hosting is one that you're gonna want to do if you're using this for internally at your work you'll have to talk to somebody that assists admin find a sysadmin and if you don't find somebody that runs the website of your company and then automating and replicating and then maybe making it shiny which you can totally do it is a very easy way to turn something you can turn dashboards into shiny quite easily all right so we're gonna talk through the first five things here basic way out printing interactive datasets interactive plots and exporting okay so first the basic layout so in what with a regular RMD when you open up a markdown it says output HTML output HTML document so to just turn something into a Flex dashboard in the most simple fashion like all you would change is from HTML document to Flex dashboard flex dashboard so there's a couple extra arguments you can add and my go-to for my basic setup is to have the vertical layout scroll so it doesn't try to compress everything into a single screen and instead lets you make a dashboard you could scroll through and orientation rows which I'll show you what what that means so here's a basic layout so this tab I'm actually this whole thing is a Flex dashboard and this is a page within the Flex dashboard that I've built in like the main in the main dashboard some of the other tabs are like I've inserted within it anyway so this basic layout this is done with rows and how you can tell is that there is that centerpiece is not you don't have exact columns lining up if you want an orientation like this where something can span across two columns then this is it's a real orientation that you want so those little things at the top are fun built-in stuff that flex board a lab that gives you this is a value box so it lets you if you just want to give a number it you can do this value box and then little gauges and that can be fun too and then also you can add favicons which you can go nuts with these there's a whole bunch of free ones and you can make your own and that is you know just makes things fun so here's a basic layout nothing too exciting this part is not hard resources this parts easy so nothing's gonna shine on that alright so now printing we're print is simply unacceptable because the point here is to make things pretty you want someone to want to look at this you want someone to want to use it you want to like make something where you can reference people to the dashboard and then they'll go and everything's pretty and nice and user friendly and they're like why are you beep a4x dashboarding tool when like you can just spit these things out so man I am so in love with this look at this like this is in my CSS that's you know this like star background of the it's so wonderful ok so now let's look at a few different things that you can use to make your printing prettier alright so this with with base are if you if you make no effort head iris terrible this is ugly don't do it don't make anyone look at that that not in a dashboard so the easiest way to make a print pretty is with print are so all I did was load print are and then I ran the exact same line headed iris and look how much better that looks so much better and I don't have to do anything I just load the library done so that's obviously a pretty simple solution to print a lot prettier okay so now descriptive stats so before I was just showing if you rose and now I'm gonna run a summary ok so again with base summary iris there's so ugly don't do that it's so easy to fix oh look at that printer add it again summary much better much better and you still and you don't actually have to change the line of code which is great ok so you can achieve the same goal some of you may have heard of cable you can achieve the same goal with table but it's just like a little bit more effort you don't you know you can take your coat that you'd already written and it gave ugly output and just add the library at the top and then make it pretty output this method you would have to actually go in and change your code so that's like more work alright and then now stargazer so this you this doesn't look good at all stargazer has a place but four summaries just a basic summary stats that is way too cramped it's like painful to look at so another one that's kind of cool that's getting better but it doesn't have all its capacities in our markdown is summary tools but keep tabs on that because it gives you a lot of cool information and soon once somebody fixes it it actually has like distribution like a column that is has little plots of just the distribution of that variable which is super cool to have a plot inside of a table but for now I'm kind of just like that's an option but printer is also a pretty simple option and once they get the plots in there then I always start using that alright so then for models again terrible don't do that base are that's a terrible printout and here printer doesn't help us so printer won't save you if you're trying to summarize model output and this is where stargazer winds stargazer stargazer model output looks just like law tech model output which you could use in it works for law tech also in other formats but it works with HTML so there's printing now I oh yeah there's some links here that you're gonna need to see for using stargazer down here I specify which statistics I want to show and you have to know the little nickname for referencing them and I have a slide here that gives you the link because they can be hard to find okay so now interactive data sets so what am i what does this mean what is different about what I was just showing you and what I'm about to show you ok look at this look at this data set do you see this hover like action and highlighting so before we were just printing something a summary I just wanted a few lines there's no need to sort things I'm not going to like I don't need to do anything with this information or the summary stats it's short it's simple I don't have any intention of downloading it whatever it's fine but if you have a whole data set you would like to provide the user with a data set this so easy with data table with DT data table so the levers DT and all I did data table iris like one-liner you can make it a lot cooler but look what it already does this is so much better and you can change this like 50 cool I could sort things right on I could search for stuff yes why don't you ever go up awesome and then a little bit more advanced slightly a few more keystrokes and now I can sort and filter at the individual columns and not just search and also what else can I do I don't know four point nine you've got search highlights all right this looks like an actual dashboard this looks like a thing in a dashboard that somebody would pay for but you can just build it yourself awesome and like that is I mean I made it into two lines but really that's like a one line of code so pretty easy and the colors right here so you can copy and paste it and insert your data set whatever it is and it just works and it's awesome all right so next interactive plots huh okay so now that we're not in PowerPoint anymore and we're talking about dashboards and we want everything to be interactive and fun our plot should be interactive and fun too so we're going to take a look at hi charter which is my favorite plotting tool it's actually if once you get good at GD plot you will find high charter to be really quite similar pipes and all I mean it's actual the actual pipes not the pluses but let's take a look okay so suppose somebody you know you're making some some bar plot so this is pretty simple you see start with the data set I can pipe it in do some manipulation and then just pipe it into a chart I have I will reference it basically go to my my github for more details on this because I'm gonna have to go kind of fast I just want to show you what it can do and like that it's not very hard so call them HKS a lot of the syntax looks pretty similar to ggplot and then look what you get I have this thing this bar plot and I can hover and I have information so you know when somebody says oh that bar plot can you put the totals at the top of the bars you're like oh my god and with this they're like fine done like oh but also can you make it separately - I want one with also just 2008 okay fine oh no but I also want mom with also just to thought okay fine also with just like one that's blank fine so pretty awesome you can make a lot of plots in one plot okay so now I'll show you just kind of like skim through this bubble plot that I've made here it also has a hover action cool it's looking at some star data and luminosity and distance and you can scale the axis so here I didn't actually log the X and the y I just scaled well I did a logarithmic scale on the x and y which is like if there's pros and cons to that but in the end if you've set if you're trying to show someone something you're like actually it's log X or log Y and then they're like oh god I don't know how to think in terms of logs here you've just scaled the axis so that you seeing the smaller it's as if it's logged but the data itself is not logged and so people tend to understand it a little bit more if you're showing it to you know some product manager or you're a director or something and you can very easily add colors in the same way that you're used to with colorize so just pick a color scheme assign with colorize and then add the colors color equals color nice so I colorized by distance of the stars and then you can add access titles which also it's very easy I show you hear essentially come back to this reference obviously I can't teach you hi Carter in like two minutes and then custom hypertext so obviously this is like terrible Wow I should at least round those numbers but also what are those numbers referring to so this is probably this is a really really great component so you can create custom hover text so you just assign the X with Dec like the X is going to be the name the Y is the value and then you use that tool tip and you can create custom tooltips and it's really easy it's just like you copy paste that and then just swap out the you know names of columns and like it's amazing this is like so this is the all it took this code to do this make this whole thing and everything up here is just colors and assigning a a custom hover text and then that's the all it takes to get you that plot so pretty cool alright last thing is oh yeah I also want to say of course there is also leaflet which is great for making interactive maps digraphs this for a time series and plotly which if you really can't let go of GG plots you can use plot leaf or as a as a wrapper okay so exporting last thing to like really make your dashboard super useful so that when you send it over to someone they they don't have to come back to you you go go to the dashboard it's all there so you can and export the data and the plots from your dashboard so let's go to the exporting tab here okay so this one is a Flex dashboard in a Flex dashboard nice so here for oopsies for hi charter it actually that is it's a little bit tricky but I wrote I found I figured out how to do it so there's a simple HC exporting which is built-in but it doesn't work I found that it and so there's this line of code that defines some things I have a script a separate script in there you just source it and then you can export so you don't have to go search the internet like I did you can just source that script and then voila in the corner you can export the images or the or the data whatever you want and then with data table same thing I've supplied the code here for exporting and then your the download button and you can download the data awesome so that they have the data and the plots and whatever they want and they don't have to come back to you and bother you while you're working on your next data manipulation or dashboard so I'm out of time but basically keep it simple organized and explore things so start with somebody else to CSS keep things organized and don't make changes that you don't know how to undo and every time you make a project try something now and that's it [Applause]
Info
Channel: Lander Analytics
Views: 4,526
Rating: 4.9767442 out of 5
Keywords:
Id: yott4quKN6s
Channel Id: undefined
Length: 21min 3sec (1263 seconds)
Published: Mon Dec 02 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.