Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2a55067

Browse files
committed
Removed unneeded packages
1 parent 0dddbe2 commit 2a55067

11 files changed

+14
-35
lines changed

‎lecture_notes/01_why_map.Rmd‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ output:
1313

1414
# Setup
1515

16-
```{r}
16+
```{r, message = F}
1717
# Install packages
1818
if (!require("pacman")) install.packages("pacman")
1919
@@ -135,7 +135,6 @@ data("airquality")
135135
```
136136

137137
```{r}
138-
# 0.029 sec elapsed
139138
tic()
140139
141140
out1 <- vector("double", ncol(airquality)) # Placeholder
@@ -151,8 +150,6 @@ toc()
151150

152151

153152
```{r}
154-
# 0.011 sec elapsed
155-
156153
tic()
157154
158155
out1 <- airquality %>% map_dbl(mean, na.rm = TRUE)

‎lecture_notes/02_more_inputs.Rmd‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ output:
1717
```{r}
1818
# Install packages
1919
if (!require("pacman")) install.packages("pacman")
20-
pacman::p_load(tidyverse, # tidyverse pkgs including purrr
21-
tictoc) # performance test
20+
pacman::p_load(tidyverse) # tidyverse pkgs including purrr
21+
2222
```
2323

2424
# Objectives

‎lecture_notes/02_more_inputs.html‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ <h1 number="1"><span class="header-section-number">1</span> Setup</h1>
253253
<pre class="r"><code># Install packages
254254
if (!require(&quot;pacman&quot;)) install.packages(&quot;pacman&quot;)</code></pre>
255255
<pre><code>## Loading required package: pacman</code></pre>
256-
<pre class="r"><code>pacman::p_load(tidyverse, # tidyverse pkgs including purrr
257-
tictoc) # performance test </code></pre>
256+
<pre class="r"><code>pacman::p_load(tidyverse) # tidyverse pkgs including purrr</code></pre>
258257
</div>
259258
<div id="objectives" class="section level1" number="2">
260259
<h1 number="2"><span class="header-section-number">2</span> Objectives</h1>

‎lecture_notes/03_map_glue.Rmd‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ output:
1818
# Install packages
1919
if (!require("pacman")) install.packages("pacman")
2020
pacman::p_load(tidyverse, # tidyverse pkgs including purrr
21-
tictoc, # performance test
2221
glue) # glue strings and objects
2322
```
2423

‎lecture_notes/03_map_glue.html‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ <h1 number="1"><span class="header-section-number">1</span> Setup</h1>
254254
if (!require(&quot;pacman&quot;)) install.packages(&quot;pacman&quot;)</code></pre>
255255
<pre><code>## Loading required package: pacman</code></pre>
256256
<pre class="r"><code>pacman::p_load(tidyverse, # tidyverse pkgs including purrr
257-
tictoc, # performance test
258257
glue) # glue strings and objects </code></pre>
259258
</div>
260259
<div id="objective" class="section level1" number="2">

‎lecture_notes/04_reduce_bind.Rmd‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ output:
1717
```{r}
1818
# Install packages
1919
if (!require("pacman")) install.packages("pacman")
20-
pacman::p_load(tidyverse, # tidyverse pkgs including purrr
21-
tictoc) # performance test
20+
pacman::p_load(tidyverse)
2221
```
2322

2423
# Objective

‎lecture_notes/04_reduce_bind.html‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ <h1 number="1"><span class="header-section-number">1</span> Setup</h1>
253253
<pre class="r"><code># Install packages
254254
if (!require(&quot;pacman&quot;)) install.packages(&quot;pacman&quot;)</code></pre>
255255
<pre><code>## Loading required package: pacman</code></pre>
256-
<pre class="r"><code>pacman::p_load(tidyverse, # tidyverse pkgs including purrr
257-
tictoc) # performance test </code></pre>
256+
<pre class="r"><code>pacman::p_load(tidyverse)</code></pre>
258257
</div>
259258
<div id="objective" class="section level1" number="2">
260259
<h1 number="2"><span class="header-section-number">2</span> Objective</h1>

‎lecture_notes/05_slower_faster.Rmd‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ walk(1:50, function(x){message("Scraping page", x)})
6262
- If you're web scraping, one problem with this approach is it's too fast by human standards.
6363

6464
```{r}
65-
66-
# 0.03 sec elapsed
6765
tic()
6866
walk(1:50, function(x){message("Scraping page", x)}) # Anonymous function; I don't name the function
6967
toc()
@@ -77,10 +75,6 @@ toc()
7775
- If a function is a verb, then a helper function is an adverb (modifying the behavior of the verb).
7876

7977
```{r,include=FALSE}
80-
81-
# 49.05 sec elapsed
82-
83-
8478
tic()
8579
8680
walk(1:50, slowly(function(x){message("Scraping page", x)},
@@ -109,12 +103,10 @@ n_cores # This number depends on your computer spec.
109103
plan(multiprocess, # multicore, if supported, otherwise multisession
110104
workers = n_cores) # the maximum number of workers
111105
112-
# 4.931 sec elapsed
113106
tic()
114107
mean100 <- map(1:100000, mean)
115108
toc()
116109
117-
# 2.536 sec elapsed
118110
tic()
119111
mean100 <- future_map(1:100000, mean)
120112
toc()

‎lecture_notes/05_slower_faster.html‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ <h1 number="5"><span class="header-section-number">5</span> Map</h1>
278278
<li><p><code>walk()</code> works same as <code>map()</code> but doesn’t store its output.</p></li>
279279
<li><p>If you’re web scraping, one problem with this approach is it’s too fast by human standards.</p></li>
280280
</ul>
281-
<pre class="r"><code># 0.03 sec elapsed
282-
tic()
281+
<pre class="r"><code>tic()
283282
walk(1:50, function(x){message(&quot;Scraping page&quot;, x)}) # Anonymous function; I don&#39;t name the function </code></pre>
284283
<pre><code>## Scraping page1</code></pre>
285284
<pre><code>## Scraping page2</code></pre>
@@ -332,7 +331,7 @@ <h1 number="5"><span class="header-section-number">5</span> Map</h1>
332331
<pre><code>## Scraping page49</code></pre>
333332
<pre><code>## Scraping page50</code></pre>
334333
<pre class="r"><code>toc()</code></pre>
335-
<pre><code>## 0.006 sec elapsed</code></pre>
334+
<pre><code>## 0.008 sec elapsed</code></pre>
336335
<ul>
337336
<li>If you want to make the function run slowly ...</li>
338337
</ul>
@@ -365,16 +364,14 @@ <h1 number="6"><span class="header-section-number">6</span> How to Make Automati
365364
## because it is considered unstable. For more details, how to control forked
366365
## processing or not, and how to silence this warning in future R sessions, see ?
367366
## parallelly::supportsMulticore</code></pre>
368-
<pre class="r"><code># 4.931 sec elapsed
369-
tic()
367+
<pre class="r"><code>tic()
370368
mean100 &lt;- map(1:100000, mean)
371369
toc()</code></pre>
372-
<pre><code>## 0.347 sec elapsed</code></pre>
373-
<pre class="r"><code># 2.536 sec elapsed
374-
tic()
370+
<pre><code>## 0.34 sec elapsed</code></pre>
371+
<pre class="r"><code>tic()
375372
mean100 &lt;- future_map(1:100000, mean)
376373
toc()</code></pre>
377-
<pre><code>## 0.488 sec elapsed</code></pre>
374+
<pre><code>## 0.467 sec elapsed</code></pre>
378375
</div>
379376

380377

‎lecture_notes/06_make_error_handling_easier.Rmd‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ output:
1818
# Install packages
1919
if (!require("pacman")) install.packages("pacman")
2020
pacman::p_load(tidyverse, # tidyverse pkgs including purrr
21-
tictoc, # performance test
2221
rvest) # web scraping
2322
```
2423

@@ -50,7 +49,7 @@ map(url_lists, read_html)
5049
5150
```
5251

53-
- This is a very simple problem so it's easy to tell where the problem is. How can you make your error more informative?
52+
- This is a toy example so it's easy to tell where the problem is. How can you make your error more informative?
5453

5554
# Solution
5655

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /