 Hey, folks, this is a great day. If you know me, well, you know that great days are days when we start new projects. And that's just what we're going to do today. Today, we're going to start a new project. And the focus of this project is going to be looking at different ways of visualizing climate change data. Specifically, I'm interested in looking at visualizations that depict the increase in temperature globally, as well as locally. So we'll start off by trying to recreate some visuals from published by NASA, looking at global climate data, and then we'll focus more locally. I've talked about this in a variety of other episodes, but some things that are really important to me when I start a project is just really getting off on a good foot in terms of reproducibility. So two things that that means. First of all, I need to have good project organization. And number two, because I want everybody to see it, I need to have it under version control and post it up into GitHub. I have found that the easiest way for people to work with version control and also to integrate that in with our studio is to start on GitHub. So let's start on GitHub. Again, you will need a GitHub account to follow along. That is very easy to do. It costs you nothing. And I would strongly encourage you to do that because again, it sets up a great practice of making your code publicly accessible and open for others to see and share. And also this becomes in a way a backup. I could accidentally delete everything on my computer or I could change computers. And I could simply pull the data down, pull the code down from my GitHub repository and get up and running again. It's a great backup in that regard. All right, so I'm at the Riffamonus account on GitHub. I'm going to create a new repository. And so there's a green new button that you might see here. Alternatively, there's a plus sign up here in the upper right corner where you could click new repository. I have a number of different accounts and projects already on GitHub. So I am going to change the owner from P. Schloss, which is my personal account that I do work on to Riffamonus, which again is the account for this overall project. And then I'm going to change the repository name to be climate underscore vis. It tells me that climate vis is available. I'm going to make this a public repository. I do want to add a read me. I do want to add a dot get ignore. And so I'm going to plop in R there. And it's really not that complicated of a name. So it doesn't really narrow things down. So I'm going to click on the R there. And so what that does is the dot get ignore file is a file that tells get what files to ignore when it's trying to consider what things to update into the repository. For the licenses, what I'm going to use is an MIT license. This is a fairly permissive license that really let anybody do whatever they want with the code. As long as they cite me and give me attribution. So I'm going to go ahead and create this repository. This then creates a repository up here on GitHub. Things are good to go. I'm going to come into code. And this gives me the address. So I'm going to go ahead and click on the copy button to the right of the address. Now I'm going to come over to our studio and I'm going to create a new project and I'm going to use this third option of creating a project from version control. I'm going to do it from get and the repository URL is that that I copied paste that in there. Again, it puts in the name of climate underscore vis and it's going to put it on my desktop for now. I'll go ahead then and create the project. And what it did was basically relaunch our studio and putting me into my GitHub repository. I now see I've got this git tab. So we see that climate vis dot our project is already created. That is the our project file that our studio uses to keep track of stuff for a project. So that's in there. That's good. I'm going to create some new folders. And so I'll try to do this all in our studio rather than go to the command line, because I know not everyone likes the command line nearly as much as I tend to. So go ahead and create a new folder. And I'm going to call this code. I'll create another new folder that I'll call data. And I'll create another new folder called figures. And so now I've got these three new folders, but you'll notice nothing here got updated, right? Like there's no new things to commit other than that our project file. And so that's because git keeps track of files, not directories. And so what I like to do is put a read me file into each of these different directories. And you never know, I might put some documentation in there, but generally that read me file is going to be blank. So I'll go ahead and create a new file. So I'll go ahead and save this as read me.md. Get rid of that r dot. And yeah, I want to use md. Yes. So I'll save that. And I'll go ahead and close that. And so now that's in figures. And you'll now see in the get tab, the figures directory is created. And that it's now keeping track of it because it's keeping track of that read me file. So I'll do that again. And maybe what I'll do instead of just a plain old vanilla R script, I'll add a new markdown document, which I don't see. So I'll try the text. And so let's go ahead and save this, not to figures, but to data, and we'll then do read me dot md into data. And now we need one for code, right? So again, do text, save read me md. And as I said, we want to put this into code. And there we go. And so now we see that we've got the R project and the three different directories. I can stage these into version control by clicking on the nice little button here. It then adds all those. The next step is to commit. So I then will commit these changes. And the message I'll put is to add a project organization to directory. All right, so we'll commit that. That's been committed, we can close it. And now I can push this up to GitHub. And now if I come back to GitHub and hit refresh, it's added those directories. And if we look in code say, there is now a read me file in there. Again, those read me files for now are basically placeholders. So that get keeps track of my project organization. I have seen sometimes people will give those files names that start with periods. That way you don't see the file. When you're looking at things say with your finder window, the period tells your operating system to not show that file. But I like to put in the read me because I could see say for like the data read me file, putting in there the URLs of the different data that we'd want to add. And speaking of that, let's go ahead and do that now. So we're going to get our data from data.giss.nasa.gov. This is a website from Nash NASA, the National Aeronautics and Space Administration, the Goddard Institute for Space Studies. So we're interested in going to data sets, and then the just temp surface temperature. So this brings us to the GISS surface temp analysis page at NASA. And so we're going to scroll down to the bottom, where they've got all sorts of different files available. And so we're mainly interested in this tables of global and hemispheric monthly means and zonal annual means. So I'm interested in this first bullet point, the global mean monthly seasonal and annual means 1880 to present updated through the most recent month. And so this will give a text file or a CSV file. What I find with the text file is that it has extra stuff added at the bottom that I don't really want. Whereas the CSV is a comma separated values file, which is what I want. So we'll go ahead and click on that. So I've gone ahead and copied that into my data directory. I'm also going to go into my data directory and open up that read me file and put in some URL. So this was the URL that we downloaded from. I also want to get this main URL of the page, the data page, right? So I'll say downloaded data from here, right? Very good. So I'll go ahead and save that. And now I've got my CSV and my read me file that I have modified. So you'll see that we already had it committed into the repository. And so now because I've modified it, we now get an M. Whereas the data file that I brought in has this yellow question marks because it's not added to the repository. So I'll go ahead and stage those. And so now we see the status for the data turns to a, which means it's been added and M for the read me because again, it's been modified. I can then commit to say add temperature data. And we commit that close and push something you do want to be careful about when you push data up to GitHub is that the files aren't too big. These files, the CSV is 12.2 kb. So that's pretty puny. Not something that I would really worry about. But you do want to be careful about pushing really large data files up to a repository like that. The other thing to keep in mind is that with our tooling from R, we don't really need to download this file, right? We could read directly from the web page without having to download the file and store it in our data directory. The downside of down so the advantage of using the web version that's always on the web is that if they update this every month, then we will always have the freshest data. The advantage of having it on my local computer is it's on my local computer. And if the internet at my house goes haywire, then I have the data. I don't have to worry about pulling it down. But you know, perhaps before I do a publication using this data that I got from online, I might want to update the file that I have locally, or I might want to go from reading the local file to reading that remote web-based file. One of the reasons I'm so interested in this project is because I feel like there's been a lot of really cool data visualization done with climate data. And I feel like it naturally tells a story that we want, we want to know more about, right? So this animation that I'm showing as I speak here is something that shows up periodically on Twitter and just gets me every time, right? It's like, you know, the train is about to wreck, but you're just waiting for things to go out of control, right? And so I think this naturally tells a story that's just really fascinating. And I would love for myself to figure out how to make this as well as to teach you how to make it as well. Also, there are these types of diagrams that are called weather stripes, or each vertical line in this image indicates a different year. And as you kind of come through time and as temperatures globally get warmer, you get warmer colors, right? And so this is something that's intriguing and something that I've seen people do is make Afghans or blankets that they've knitted or crocheted where each row or set of rows corresponds to the color of that year, which would be pretty depressing. I'm not so much into Afghans or, you know, quilts, things like that, but maybe a necktie, right? That would be an interesting conversation starter, right? Who knows? I'm not really one for neckties either, if you can't imagine that. Another image that I find compelling also are these bar plots, where again, each bar represents a different year and its length, the deviation from kind of an average temperature between I think it was 1951 in 1980. And so, which again is probably right around in here, right? Anyway, I think this is pretty interesting and I would love to make this with you as well. You'll notice that these figures that I'm showing you on this website comes from showyourstripes.info. This has a really nice built-in browser so that you could say, well, what do things look like in North America where I am? And perhaps instead of all of North America, maybe I want the United States, right? And so here with the United States, you can see, you know, what do the temperature deviations look like over the past 130 years or so. And I could imagine doing this even more fine scale, right? Well, so this allows me to go down into Michigan. Let's see, Michigan there. And so this is the temperature change in Michigan. And while there was a year, I don't know, maybe 15 years ago, that was pretty cold compared to all the other years, we again see the general trend. But Michigan is a big state, right? It spans North, South pretty wide. So what do things look like in Ann Arbor, where close to where I live and where I work, right? And could you make the same type of plot from where you live and where you work, right? And so what I want to do is let's start this with the global, try to reproduce figures that other people have made for global temperature change, and then see how we can look more locally. Again, climate is over a long period of time, and is global. But I want to know how this manifests itself in my neck of the hoods, right? Where I live in southeastern Michigan. How has the climate changed over the past 140 years or so? So that you don't miss those upcoming episodes, please, please, please be sure you've subscribed to the channel. You've clicked that bell icon so you receive notifications of new episodes. You click the thumbs up on this. And by all means, please tell your friends about what we're doing here so that you and they can follow along. I find that people get the most out of this when they go through all the exercises themselves, but it's even better when they go through it with a buddy so that if they run into a problem, they can say, Hey, friend, did you get this to work out? What am I doing wrong? Right? Then you can share information and you can teach each other and learn it that much better. All right, we'll see you next time for another episode of Code Club.