Skip to content

Commit 797cf94

Browse files
committedAug 17, 2019
package dev
1 parent 9ce16e9 commit 797cf94

18 files changed

+104
-26
lines changed
 

‎09-package_development.Rmd

+54-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ believe me, it will make things a thousand times easier.
3232

3333
Code that is inside packages is very easy to document and test, especially if you're using Rstudio.
3434
It also makes it possible to use the wonderful `{covr}` package, which tells you which lines in
35-
which functions are called by your tests. If some lines are missing, write tests that invoke them and increase the coverage of your tests! Documenting and testing your code is very important; it gives
35+
which functions are called by your tests. If some lines are missing, write tests that invoke them and
36+
increase the coverage of your tests! Documenting and testing your code is very important; it gives
3637
you assurance that the code your writing works, but most importantly, it gives *others* assurance
3738
that what you wrote works. And I include future you in these *others* too.
3839

@@ -50,25 +51,73 @@ distributing this package easy, we're going to put it up on Github, so you'll ne
5051

5152
Let's start by creating a Github account.
5253

53-
### Setting up Github account
54+
### Setting up a Github account
5455

55-
### Starting your package
56+
Setting up a Github account is very easy; just go over to [https://github.com/](https://github.com/)
57+
and simply sign up!
58+
59+
Then you will need to generate a ssh key on your computer. This is a way for you to securely
60+
interact with your Github account, and push your code to the repository without having to always
61+
type your password. I will assume you never created any ssh
62+
keys before, because if you already did, you could skip these steps. I will also assume that you are
63+
on a GNU+Linux or macOS system; if you're using windows, the instructions are very similar, but
64+
you'll first need to install Git available [here](https://git-scm.com/downloads). Git is available
65+
by default on any GNU+Linux system, and as far as I know also on macOS, but I might be wrong and
66+
you might also need to install git on macOS (but then the instructions are the same whether
67+
you're using GNU+Linux or macOS). If you have trouble installing git, read the following section
68+
from the [Pro Git book](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
69+
70+
Then, open a terminal (or the git command line on Windows) and type the following:
71+
72+
```
73+
ssh-keygen
74+
```
75+
76+
This command will generate several files in the `.ssh` directory inside your `HOME` directory. Look
77+
for the file that ends with the `.pub` extension, and copy its contents. You will need to paste
78+
these contents on Github.
79+
80+
So now sign in to Github; once you are signed in, go to settings and then `SSH and GPG keys`:
81+
82+
```{r, echo=FALSE}
83+
knitr::include_graphics("pics/github_ssh.png")
84+
```
5685

86+
In the screenshot above, you see my ssh key associated with my account; this will be empty for you.
87+
Click on the top right, *New SSH key*:
88+
89+
```{r, echo=FALSE}
90+
knitr::include_graphics("pics/github_add_ssh.png")
91+
```
92+
93+
Give your key a name, and paste the key you generated before. You're done! You can now configure
94+
git a bit more by telling it who you are. Open a terminal, adapt and type the following commands:
95+
96+
```
97+
git config --global user.name "Harold Zurcher"
98+
git config --global user.email harold.zurcher@madisonbus.com
99+
```
100+
101+
You're ready to go!
102+
103+
### Starting your package
57104

58105
```{r, echo=FALSE}
59106
knitr::include_graphics("pics/new_package.gif")
60107
```
61108

62109
To start writing a package, the easiest way is to load up Rstudio and start a new project, under the
63110
*File* menu. If you're starting from scratch, just choose the first option, *New Directory* and then
64-
*R package*. Give a new to your package, for example `myFirstPackage` and you can also choose to use
65-
git for version control. Now if you check the folder where you chose to save your package, you will
111+
*R package*. Give a new to your package, for example `castles` (you'll see why in a bit) and you can
112+
also choose to use git for version control. Now if you check the folder where you chose to save your package, you will
66113
see a folder with the same name as your package, and inside this folder a lot of new files and other
67114
folders. The most important folder for now is the `R` folder. This is the folder that will hold your
68115
`.R` source code files. You can also see these files and folders inside the *Files* panel from within
69116
Rstudio. Rstudio will also have `hello.R` opened, which is a single demo source file inside the `R`
70117
folder. You can get rid of this file.
71118

119+
Now,
120+
72121

73122
## Adding functions to your package
74123

‎docs/defining-your-own-functions.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>
@@ -679,12 +679,12 @@ <h3><span class="header-section-number">7.2.2</span> Fibonacci numbers</h3>
679679
then? Try to run the following:</p>
680680
<div class="sourceCode" id="cb961"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb961-1" data-line-number="1"><span class="kw">system.time</span>(<span class="kw">my_fibo</span>(<span class="dv">30</span>))</a></code></pre></div>
681681
<pre><code>## user system elapsed
682-
## 0.01 0.00 0.01</code></pre>
682+
## 0.004 0.000 0.005</code></pre>
683683
<p>The result should be printed very fast (the <code>system.time()</code> function returns the time that it took
684684
to execute <code>my_fibo(30)</code>). Let’s try with the recursive version:</p>
685685
<div class="sourceCode" id="cb963"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb963-1" data-line-number="1"><span class="kw">system.time</span>(<span class="kw">fibo_recur</span>(<span class="dv">30</span>))</a></code></pre></div>
686686
<pre><code>## user system elapsed
687-
## 1.129 0.000 1.130</code></pre>
687+
## 1.058 0.000 1.058</code></pre>
688688
<p>It takes much longer to execute! Recursive algorithms are very CPU demanding, so if speed is
689689
critical, it’s best to avoid recursive algorithms. Also, in <code>fibo_recur()</code> try to remove this line:
690690
<code>if (n == 0 || n == 1)</code> and try to run <code>fibo_recur(5)</code> and see what happens. You should

‎docs/descriptive-statistics-and-data-manipulation.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>

‎docs/functional-programming.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>

‎docs/further-topics.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>

‎docs/getting-to-know-rstudio.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>

‎docs/graphs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>

‎docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>

‎docs/objects-types-and-useful-r-functions-to-get-started.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>

‎docs/package-development.html

+35-6
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>
@@ -395,7 +395,8 @@ <h2><span class="header-section-number">9.1</span> Why you need to write your ow
395395
believe me, it will make things a thousand times easier.</p>
396396
<p>Code that is inside packages is very easy to document and test, especially if you’re using Rstudio.
397397
It also makes it possible to use the wonderful <code>{covr}</code> package, which tells you which lines in
398-
which functions are called by your tests. If some lines are missing, write tests that invoke them and increase the coverage of your tests! Documenting and testing your code is very important; it gives
398+
which functions are called by your tests. If some lines are missing, write tests that invoke them and
399+
increase the coverage of your tests! Documenting and testing your code is very important; it gives
399400
you assurance that the code your writing works, but most importantly, it gives <em>others</em> assurance
400401
that what you wrote works. And I include future you in these <em>others</em> too.</p>
401402
<p>In order to share this package with these <em>others</em> we are going to use git. If you’re familiar with
@@ -409,21 +410,49 @@ <h2><span class="header-section-number">9.2</span> Starting easy: creating a pac
409410
going to scrape a table off Wikipedia, prepare the data and then include it in a package. To make
410411
distributing this package easy, we’re going to put it up on Github, so you’ll need a Github account.</p>
411412
<p>Let’s start by creating a Github account.</p>
412-
<div id="setting-up-github-account" class="section level3">
413-
<h3><span class="header-section-number">9.2.1</span> Setting up Github account</h3>
413+
<div id="setting-up-a-github-account" class="section level3">
414+
<h3><span class="header-section-number">9.2.1</span> Setting up a Github account</h3>
415+
<p>Setting up a Github account is very easy; just go over to <a href="https://github.com/">https://github.com/</a>
416+
and simply sign up!</p>
417+
<p>Then you will need to generate a ssh key on your computer. This is a way for you to securely
418+
interact with your Github account, and push your code to the repository without having to always
419+
type your password. I will assume you never created any ssh
420+
keys before, because if you already did, you could skip these steps. I will also assume that you are
421+
on a GNU+Linux or macOS system; if you’re using windows, the instructions are very similar, but
422+
you’ll first need to install Git available <a href="https://git-scm.com/downloads">here</a>. Git is available
423+
by default on any GNU+Linux system, and as far as I know also on macOS, but I might be wrong and
424+
you might also need to install git on macOS (but then the instructions are the same whether
425+
you’re using GNU+Linux or macOS). If you have trouble installing git, read the following section
426+
from the <a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">Pro Git book</a>.</p>
427+
<p>Then, open a terminal (or the git command line on Windows) and type the following:</p>
428+
<pre><code>ssh-keygen</code></pre>
429+
<p>This command will generate several files in the <code>.ssh</code> directory inside your <code>HOME</code> directory. Look
430+
for the file that ends with the <code>.pub</code> extension, and copy its contents. You will need to paste
431+
these contents on Github.</p>
432+
<p>So now sign in to Github; once you are signed in, go to settings and then <code>SSH and GPG keys</code>:</p>
433+
<p><img src="pics/github_ssh.png" /><!-- --></p>
434+
<p>In the screenshot above, you see my ssh key associated with my account; this will be empty for you.
435+
Click on the top right, <em>New SSH key</em>:</p>
436+
<p><img src="pics/github_add_ssh.png" /><!-- --></p>
437+
<p>Give your key a name, and paste the key you generated before. You’re done! You can now configure
438+
git a bit more by telling it who you are. Open a terminal, adapt and type the following commands:</p>
439+
<pre><code>git config --global user.name &quot;Harold Zurcher&quot;
440+
git config --global user.email harold.zurcher@madisonbus.com</code></pre>
441+
<p>You’re ready to go!</p>
414442
</div>
415443
<div id="starting-your-package" class="section level3">
416444
<h3><span class="header-section-number">9.2.2</span> Starting your package</h3>
417445
<p><img src="pics/new_package.gif" /><!-- --></p>
418446
<p>To start writing a package, the easiest way is to load up Rstudio and start a new project, under the
419447
<em>File</em> menu. If you’re starting from scratch, just choose the first option, <em>New Directory</em> and then
420-
<em>R package</em>. Give a new to your package, for example <code>myFirstPackage</code> and you can also choose to use
421-
git for version control. Now if you check the folder where you chose to save your package, you will
448+
<em>R package</em>. Give a new to your package, for example <code>castles</code> (you’ll see why in a bit) and you can
449+
also choose to use git for version control. Now if you check the folder where you chose to save your package, you will
422450
see a folder with the same name as your package, and inside this folder a lot of new files and other
423451
folders. The most important folder for now is the <code>R</code> folder. This is the folder that will hold your
424452
<code>.R</code> source code files. You can also see these files and folders inside the <em>Files</em> panel from within
425453
Rstudio. Rstudio will also have <code>hello.R</code> opened, which is a single demo source file inside the <code>R</code>
426454
folder. You can get rid of this file.</p>
455+
<p>Now,</p>
427456
</div>
428457
</div>
429458
<div id="adding-functions-to-your-package" class="section level2">

‎docs/pics/github_add_ssh.png

54.6 KB
Loading

‎docs/pics/github_ssh.png

22.6 KB
Loading

‎docs/reading-and-writing-data.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>

‎docs/references.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>

‎docs/search_index.json

+2-2
Large diffs are not rendered by default.

‎docs/statistical-models.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<li class="chapter" data-level="9" data-path="package-development.html"><a href="package-development.html"><i class="fa fa-check"></i><b>9</b> Package development</a><ul>
333333
<li class="chapter" data-level="9.1" data-path="package-development.html"><a href="package-development.html#why-you-need-to-write-your-own-package"><i class="fa fa-check"></i><b>9.1</b> Why you need to write your own package</a></li>
334334
<li class="chapter" data-level="9.2" data-path="package-development.html"><a href="package-development.html#starting-easy-creating-a-package-to-share-data"><i class="fa fa-check"></i><b>9.2</b> Starting easy: creating a package to share data</a><ul>
335-
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up Github account</a></li>
335+
<li class="chapter" data-level="9.2.1" data-path="package-development.html"><a href="package-development.html#setting-up-a-github-account"><i class="fa fa-check"></i><b>9.2.1</b> Setting up a Github account</a></li>
336336
<li class="chapter" data-level="9.2.2" data-path="package-development.html"><a href="package-development.html#starting-your-package"><i class="fa fa-check"></i><b>9.2.2</b> Starting your package</a></li>
337337
</ul></li>
338338
<li class="chapter" data-level="9.3" data-path="package-development.html"><a href="package-development.html#adding-functions-to-your-package"><i class="fa fa-check"></i><b>9.3</b> Adding functions to your package</a></li>

‎pics/github_add_ssh.png

54.6 KB
Loading

‎pics/github_ssh.png

22.6 KB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.