5.4 Download this book’s files
If you’d like to use R to download all the data files (and some R scripts) from this book’s GitHub repository, run
usethis::use_course("https://github.com/smach/R4JournalismBook/archive/master.zip", "your/dir/path")
Replace “your/dir/path” with the local path on your system under which you’d like a new RStudio project created. On Windows, for example, you might use “C:/Users/YourName/Documents,” and a new R4JournalismBook-master directory – and RStudio project – would be created inside your Documents directory.
If you don’t want to create a new directory and project, you can download and unzip files manually. Head to the URL for this book’s GitHub repository at https://github.com/smach/R4JournalismBook, and look for a green button that offers you the option to “Clone or download.” See Figure 5.1. Click it, and you’ll have an option to download the entire repository as a zipped file. You can then unzip and place files and the data subdirectory in an existing directory of your choice.
Note: If you’ve used git before and have it installed on your local system, you can use RStudio’s File > New Project menu to select “Version Control - Checkout a project from a version control repository.” Then, simply follow the prompts for a git project, using the book repo’s URL: https://github.com/smach/R4JournalismBook.git. You may first have to tell RStudio the location of your local git installation. If so, firsthead to Tools > Global Options > Git/SVN.
Whichever way you choose, you should now have all the necessary data files in a data subdirectory on your local system.