Now that we've made several changes, let's go ahead and
back everything up to your GitHub account.
Open your Git Bash window and make sure that you're in the RepTemplates folder for
the WCtemplatePackage, then type in git add, to add all of the new files and
git commit, then type in the command to push everything up to the repository.
We'll type in get status to check that there is nothing left to commit.
The working tree is clean, you can go back to the GitHub repository and
click Refresh.
Now everything is synced up with your GitHub account.
Finally let's make one last edition.
In your GitHub repository, there's a button at the bottom for
adding a README file.
Click on Add a README.
Type in the following instructions to your readers on how to install and
use your new R package within your weather check template.
But be sure to put in your username for your GitHub account in this README file.
The instructions for doing this are provided in your Read Ahead materials.
So we've typed in some information here that says that this is an R package
that provides an R Markdown Template for
creating a report from the weather check data set.
And then we've also provided some information on how to install
the development version of this package.
Next we show the code to the reader for
installing this package using the devtools install GitHub command.
Now that we've updated the README file here, go ahead and
add a comment that we created a new readme file and click Commit New File.
We now have a new readme file for anyone that's reading your new GitHub repository.
However, now that we've made this change in the GitHub repository,
we need to sync it with your local drive.
This time, let's open the Git Bash window,
and instead of typing in git push, we're actually going to do a pull.
Type in git pull.
Now you can check your file folder for the WCtemplatePackage and
you'll notice that we have a README file installed on your local drive.
So now that we've done all of this,
let's actually try installing the package from your GitHub repository.
First we need to remove the previous local installation.
So click on the packages tab in the bottom right and
scroll down to find where your new package was installed.
You'll notice that we see the listing here for the WCtemplatePackage.
There's a little x at the right, if we click on that it will remove the package.
It says, do you want to permanently uninstall, this can't be undone.
Click Yes.
Now if you try to create an R Markdown package with this template,
it's no longer shown.
So if I click on File > New File > R Markdown from Template, and
scroll through the list, I no longer see the template with the WCtemplatePackage.
This time we're going to install it from your GitHub repository.
To do this, go to the R Studio console window, and
type in the devtools command that you had written on your README file.
Remember, that part of this command includes your GitHub user ID.
So your ID will look slightly different than mine, and then click Enter.
It's now installing the WCtemplatePackage off of your GitHub repository.
To check to make sure that this worked, let's go back to File > New File >
R Markdown from Template and scroll down, and you should again see
the weather check report template from your WCtemplatePackage.