Skip to content

Commit b9acf13

Browse files
committed
Merge branch 'main' of https://github.com/jhudsl/intro_to_r into main
2 parents 9b2097d + 3e78d5e commit b9acf13

File tree

28 files changed

+68
-68
lines changed

28 files changed

+68
-68
lines changed

modules/Basic_R/Basic_R.pdf

0 Bytes
Binary file not shown.

modules/Basic_R/lab/Basic_R_Lab_Key.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -291,16 +291,16 @@ <h1>Part 3</h1>
291291
replace = TRUE
292292
)
293293
my_responses</code></pre>
294-
<pre><code>## [1] &quot;Neutral&quot; &quot;Strongly Agree&quot; &quot;Neutral&quot;
295-
## [4] &quot;Strongly Agree&quot; &quot;Disagree&quot; &quot;Disagree&quot;
296-
## [7] &quot;Strongly Agree&quot; &quot;Agree&quot; &quot;Neutral&quot;
297-
## [10] &quot;Strongly Agree&quot; &quot;Disagree&quot; &quot;Neutral&quot;
298-
## [13] &quot;Disagree&quot; &quot;Neutral&quot; &quot;Strongly Agree&quot;
299-
## [16] &quot;Neutral&quot; &quot;Neutral&quot; &quot;Disagree&quot;
300-
## [19] &quot;Neutral&quot; &quot;Strongly Disagree&quot; &quot;Agree&quot;
301-
## [22] &quot;Disagree&quot; &quot;Strongly Disagree&quot; &quot;Neutral&quot;
302-
## [25] &quot;Agree&quot; &quot;Strongly Agree&quot; &quot;Disagree&quot;
303-
## [28] &quot;Disagree&quot; &quot;Neutral&quot; &quot;Agree&quot;</code></pre>
294+
<pre><code>## [1] &quot;Strongly Disagree&quot; &quot;Neutral&quot; &quot;Agree&quot;
295+
## [4] &quot;Strongly Agree&quot; &quot;Strongly Disagree&quot; &quot;Strongly Disagree&quot;
296+
## [7] &quot;Strongly Disagree&quot; &quot;Disagree&quot; &quot;Strongly Disagree&quot;
297+
## [10] &quot;Strongly Disagree&quot; &quot;Strongly Agree&quot; &quot;Strongly Agree&quot;
298+
## [13] &quot;Disagree&quot; &quot;Agree&quot; &quot;Strongly Agree&quot;
299+
## [16] &quot;Strongly Disagree&quot; &quot;Agree&quot; &quot;Neutral&quot;
300+
## [19] &quot;Disagree&quot; &quot;Strongly Disagree&quot; &quot;Strongly Agree&quot;
301+
## [22] &quot;Neutral&quot; &quot;Strongly Agree&quot; &quot;Strongly Agree&quot;
302+
## [25] &quot;Strongly Agree&quot; &quot;Disagree&quot; &quot;Neutral&quot;
303+
## [28] &quot;Strongly Agree&quot; &quot;Strongly Disagree&quot; &quot;Strongly Disagree&quot;</code></pre>
304304
<p><strong>Bonus / Extra practice</strong>: Let’s say you change your survey so participants can rank their response 1-10 (inclusive). Create a randomly sampled vector of 30 survey responses. (hint use <code>seq()</code> and <code>sample()</code> and set the replace argument to <code>TRUE</code>). Store the output as <code>my_responses_2</code>. Examine the data by typing the name in the Console using a function.</p>
305305
<pre class="r"><code>my_responses_2 &lt;- sample(
306306
x = seq(from = 1, to = 10),

modules/Data_Classes/Data_Classes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
215215
<li>Double</li>
216216
</ol>
217217

218-
</article></slide><slide class=""><hgroup><h2>Integer</h2></hgroup><article id="integer" class="small">
218+
</article></slide><slide class=""><hgroup><h2>Integer</h2></hgroup><article class="small" id="integer">
219219

220220
<p><code>Integer</code> is a special subset of <code>numeric</code> that contains only <span style="color: red;">
221221
whole numbers</span>.</p>

modules/Data_Cleaning/Data_Cleaning.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
204204
<li>The <code>lubridate</code> package is helpful for dates and times<br/>📃<a href='https://jhudatascience.org/intro_to_r/modules/cheatsheets/Day-4.pdf' title=''>Cheatsheet</a></li>
205205
</ul>
206206

207-
</article></slide><slide class=""><hgroup><h2>Data Cleaning</h2></hgroup><article class="emphasized" id="data-cleaning">
207+
</article></slide><slide class=""><hgroup><h2>Data Cleaning</h2></hgroup><article id="data-cleaning" class="emphasized">
208208

209209
<p>In general, data cleaning is a process of investigating your data for inaccuracies, or recoding it in a way that makes it more manageable.</p>
210210

@@ -225,7 +225,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
225225
<li><code>Inf</code> and <code>-Inf</code> - Infinity, happens when you divide a positive number (or negative number) by 0.</li>
226226
</ul>
227227

228-
</article></slide><slide class=""><hgroup><h2>Finding Missing data</h2></hgroup><article class="small" id="finding-missing-data">
228+
</article></slide><slide class=""><hgroup><h2>Finding Missing data</h2></hgroup><article id="finding-missing-data" class="small">
229229

230230
<ul>
231231
<li><code>is.na</code> - looks for <code>NAN</code> and <code>NA</code></li>
@@ -251,7 +251,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
251251

252252
<pre >[1] FALSE FALSE TRUE</pre>
253253

254-
</article></slide><slide class=""><hgroup><h2>Useful checking functions</h2></hgroup><article class="small" id="useful-checking-functions">
254+
</article></slide><slide class=""><hgroup><h2>Useful checking functions</h2></hgroup><article id="useful-checking-functions" class="small">
255255

256256
<ul>
257257
<li><code>any</code> will be <code>TRUE</code> if ANY are true
@@ -538,7 +538,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
538538

539539
<p><strong><code>filter()</code> removes missing values by default.</strong> Because R can’t tell for sure if an <code>NA</code> value meets the condition. To keep them need to add <code>is.na()</code> conditional.</p>
540540

541-
</article></slide><slide class=""><hgroup><h2>filter() and missing data</h2></hgroup><article class="codesmall" id="filter-and-missing-data-1">
541+
</article></slide><slide class=""><hgroup><h2>filter() and missing data</h2></hgroup><article id="filter-and-missing-data-1" class="codesmall">
542542

543543
<pre class = 'prettyprint lang-r'>df</pre>
544544

@@ -612,7 +612,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
612612
1 2 6
613613
2 1 2</pre>
614614

615-
</article></slide><slide class=""><hgroup><h2>Drop <strong>columns</strong> with any missing values</h2></hgroup><article class="codesmall" id="drop-columns-with-any-missing-values">
615+
</article></slide><slide class=""><hgroup><h2>Drop <strong>columns</strong> with any missing values</h2></hgroup><article id="drop-columns-with-any-missing-values" class="codesmall">
616616

617617
<p>Use the <code>miss_var_which()</code> function from <code>naniar</code></p>
618618

@@ -633,7 +633,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
633633

634634
<pre >[1] &quot;Dog&quot; &quot;Cat&quot;</pre>
635635

636-
</article></slide><slide class=""><hgroup><h2>Drop <strong>columns</strong> with any missing values</h2></hgroup><article class="codesmall" id="drop-columns-with-any-missing-values-1">
636+
</article></slide><slide class=""><hgroup><h2>Drop <strong>columns</strong> with any missing values</h2></hgroup><article id="drop-columns-with-any-missing-values-1" class="codesmall">
637637

638638
<pre class = 'prettyprint lang-r'>df %&gt;% select(!miss_var_which(df))</pre>
639639

@@ -647,7 +647,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
647647
5 5
648648
6 6</pre>
649649

650-
</article></slide><slide class=""><hgroup><h2>Removing columns with threshold of percent missing row values</h2></hgroup><article class="codesmall" id="removing-columns-with-threshold-of-percent-missing-row-values">
650+
</article></slide><slide class=""><hgroup><h2>Removing columns with threshold of percent missing row values</h2></hgroup><article id="removing-columns-with-threshold-of-percent-missing-row-values" class="codesmall">
651651

652652
<pre class = 'prettyprint lang-r'>is.na(df) %&gt;% head(n = 3)</pre>
653653

@@ -712,7 +712,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
712712

713713
<p>You might want to keep the <code>NA</code> values so that you know the original sample size.</p>
714714

715-
</article></slide><slide class=""><hgroup><h2>Word of caution</h2></hgroup><article class="codesmall" id="word-of-caution">
715+
</article></slide><slide class=""><hgroup><h2>Word of caution</h2></hgroup><article id="word-of-caution" class="codesmall">
716716

717717
<p>Calculating percentages will give you a different result depending on your choice to include NA values.</p>
718718

0 Bytes
Binary file not shown.

modules/Data_Input/Data_Input.pdf

1.1 MB
Binary file not shown.
0 Bytes
Binary file not shown.

modules/Data_Summarization/Data_Summarization.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
248248
<pre > 0% 25% 50% 75% 100%
249249
1.0 2.5 4.5 6.5 8.0 </pre>
250250

251-
</article></slide><slide class=""><hgroup><h2>Statistical summarization</h2></hgroup><article class="codesmall" id="statistical-summarization-2">
251+
</article></slide><slide class=""><hgroup><h2>Statistical summarization</h2></hgroup><article id="statistical-summarization-2" class="codesmall">
252252

253253
<p>We will talk more about data types later, but you can only do summarization on numeric or logical types. Not characters.</p>
254254

modules/Data_Visualization/Data_Visualization.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)