Skip to content

Commit

Permalink
fixing links
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalab committed May 16, 2024
1 parent 0f85dbe commit 7c02c7b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1074,8 +1074,8 @@ <h2 class="subtitle"><em>Data Analysis and Prediction Algorithms with R</em></h2
<h1>New edition available<a href="index.html#new-edition-available" class="anchor-section" aria-label="Anchor link to header"></a></h1>
<p>This is the website for the first edition of Introduction to Data Science. <strong>This book is now out-of-date</strong>. We recommend using the second edition which is now divided into two parts:</p>
<ul>
<li><p><a href="Statistics%20and%20Prediction%20Algorithms%20Through%20Case%20Studies">Data Wrangling and Visualization with R</a>.</p></li>
<li><p><a href="Statistics%20and%20Prediction%20Algorithms%20Through%20Case%20Studies">Statistics and Prediction Algorithms Through Case Studies</a>.</p></li>
<li><p><a href="https://rafalab.dfci.harvard.edu/dsbook-part-1/">Data Wrangling and Visualization with R</a>.</p></li>
<li><p><a href="https://rafalab.dfci.harvard.edu/dsbook-part-2/">Statistics and Prediction Algorithms Through Case Studies</a>.</p></li>
</ul>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion docs/preface-for-first-edition.html
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ <h1>Preface for first edition<a href="preface-for-first-edition.html#preface-for
<p>This book was published with <a href="https://github.com/rstudio/bookdown">bookdown</a>. The <strong>R markdown code</strong> used to generate the book is available on <a href="https://github.com/rafalab/dsbook">GitHub</a><!--^[https://github.com/rafalab/dsbook]-->. Note that, the graphical theme used for plots throughout the book can be recreated using the <code>ds_theme_set()</code> function from <strong>dslabs</strong> package.</p>
<p>This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International <a href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a>.</p>
<p>We make announcements related to the book on Twitter. For updates follow <a href="https://twitter.com/rafalab">@rafalab</a>.</p>
<p>Last update: 2024-04-20 15:39:38.340857</p>
<p>Last update: 2024-05-16 10:16:40.051502</p>
</div>
</section>

Expand Down
14 changes: 7 additions & 7 deletions docs/reproducible-projects-with-rstudio-and-r-markdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ <h2><span class="header-section-number">40.1</span> RStudio projects<a href="rep
<p>RStudio provides a way to keep all the components of a data analysis project organized into one folder and to keep track of information about this project, such as the Git status of files, in one file. In Section <a href="git.html#rstudio-git">39.6</a> we demonstrate how RStudio facilitates the use of Git and GitHub through RStudio projects. In this section we quickly demonstrate how to start a new a project and some recommendations on how to keep these organized. RStudio projects also permit you to have several RStudio sessions open and keep track of which is which.</p>
<p>To start a project, click on <em>File</em> and then <em>New Project</em>. Often we have already created a folder to save the work, as we did in Section <a href="unix.html#prep-project">38.7</a> and we select <em>Existing Directory</em>. Here we show an example
in which we have not yet created a folder and select the <em>New Directory</em> option.</p>
<p><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_09_20_21.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_09_20_28.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_09_20_21.png" width="70%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_09_20_28.png" width="70%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p>Then, for a data analysis project, you usually select the <em>New Project</em> option:</p>
<p><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_09_20_35.png" width="70%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p>Now you will have to decide on the location of the folder that will be associated with your project, as well as the name of the folder. When choosing a folder name, just like with file names, make sure it is a meaningful name that will help you remember what the project is about. As with files, we recommend using lower case letters, no spaces, and hyphens to separate words. We will call the folder for this project <em>my-first-project</em>. This will then generate a <em>Rproj</em> file called <em>my-first-project.Rproj</em> in the folder associated with the project. We will see how this is useful a few lines below.</p>
Expand Down Expand Up @@ -1142,25 +1142,25 @@ <h3><span class="header-section-number">40.2.3</span> Global options<a href="rep
<div id="knitr" class="section level3 hasAnchor" number="40.2.4">
<h3><span class="header-section-number">40.2.4</span> knitR<a href="reproducible-projects-with-rstudio-and-r-markdown.html#knitr" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>We use the <strong>knitR</strong> package to compile R markdown documents. The specific function used to compile is the <code>knit</code> function, which takes a filename as input. RStudio provides a button that makes it easier to compile the document. For the screenshot below, we have edited the document so that a report on gun murders is produced. You can see the file here: <a href="https://raw.githubusercontent.com/rairizarry/murders/master/report.Rmd">https://raw.githubusercontent.com/rairizarry/murders/master/report.Rmd</a>. You can now click on the <code>Knit</code> button:</p>
<p><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_21.0.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_21.0.png" width="70%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p>The first time you click on the <em>Knit</em> button, a dialog box may appear asking you to install packages you need.
<!--
<img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_21.5.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" />
<img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_21.5.png" width="70%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" />
--></p>
<p>Once you have installed the packages, clicking the <em>Knit</em> will compile your R markdown file and the resulting document will pop up:</p>
<p>This produces an html document which you can see in your working directory. To view it, open a terminal and list the files. You can open the file in a browser and use this to present your analysis. You can also produce a PDF or Microsoft document by changing:</p>
<p><code>output: html_document</code> to <code>output: pdf_document</code> or <code>output: word_document</code>.</p>
<p>We can also produce documents that render on GitHub using <code>output: github_document</code>.
<!--
<img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_23.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" />
<img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_23.png" width="70%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" />
-->
This will produce a markdown file, with suffix <code>md</code>, that renders in GitHub. Because we have uploaded these files to GitHub, you can click on the <code>md</code> file and you will see the report as a webpage:</p>
<!--
<img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_37.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" />
<img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_37.png" width="70%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" />
-->
<p><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_38.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_38.png" width="70%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p>This is a convenient way to share your reports.</p>
</div>
<div id="more-on-r-markdown" class="section level3 hasAnchor" number="40.2.5">
Expand Down Expand Up @@ -1260,7 +1260,7 @@ <h3><span class="header-section-number">40.3.7</span> Add, commit, and push file
<p><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_32.png" width="30%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_34.png" width="30%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_35.png" width="30%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p>We can now go to GitHub and confirm that our files are there.
<!--
<img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_37.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" />
<img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_37.png" width="70%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" />
-->
You can see a version of this project, organized with Unix directories, on GitHub<a href="#fn123" class="footnote-ref" id="fnref123"><sup>123</sup></a>.
You can download a copy to your computer by using the <code>git clone</code> command on your terminal. This command will create a directory called <code>murders</code> in your working directory, so be careful where you call it from.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/search_index.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/unix.html
Original file line number Diff line number Diff line change
Expand Up @@ -1112,23 +1112,23 @@ <h2><span class="header-section-number">38.3</span> The filesystem<a href="unix.
<h3><span class="header-section-number">38.3.1</span> Directories and subdirectories<a href="unix.html#directories-and-subdirectories" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>The first concept you need to grasp to become a Unix user is how your filesystem is organized. You should think of it as a series of nested folders, each containing files, folders, and executables.</p>
<p>Here is a visual representation of the structure we are describing:</p>
<p><img src="productivity/img/unix/filesystem.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p><img src="productivity/img/unix/filesystem.png" width="70%" style="display: block; margin: auto;" /></p>
<p>In Unix, we refer to folders as <em>directories</em>. Directories that are inside other directories are often referred to as <em>subdirectories</em>. So, for example, in the figure above, the directory <em>docs</em> has two subdirectories: <em>reports</em> and <em>resumes</em>, and <em>docs</em> is a subdirectory of <em>home</em>.</p>
</div>
<div id="the-home-directory" class="section level3 hasAnchor" number="38.3.2">
<h3><span class="header-section-number">38.3.2</span> The home directory<a href="unix.html#the-home-directory" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>The <em>home</em> directory is where all your stuff is kept, as opposed to the system files that come with your computer, which are kept elsewhere. In the figure above, the directory called <em>home</em> represents your home directory, but that is rarely the name used. On your system, the name of your home directory is likely the same as your username on that system. Below are an example on Windows and Mac showing a home directory, in this case, named <em>rafa</em>:</p>
<p><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_13.png" width="45%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /><img src="productivity/img/mac-screenshots/Screen-Shot-2018-04-13-at-4.34.01-PM.png" width="45%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p><img src="productivity/img/windows-screenshots/VirtualBox_Windows-7-Enterprise_23_03_2018_14_53_13.png" width="45%" style="display: block; margin: auto;" /><img src="productivity/img/mac-screenshots/Screen-Shot-2018-04-13-at-4.34.01-PM.png" width="45%" style="display: block; margin: auto;" /></p>
<!--
Here is an example from a Mac:
<img src="productivity/img/mac-screenshots/Screen-Shot-2018-04-13-at-4.34.01-PM.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" />
<img src="productivity/img/mac-screenshots/Screen-Shot-2018-04-13-at-4.34.01-PM.png" width="70%" style="display: block; margin: auto;" />
-->
<p>Now, look back at the figure showing a filesystem. Suppose you are using a point-and-click system and you want to remove the file <em>cv.tex</em>. Imagine that on your screen you can see the <em>home</em> directory. To erase this file, you would double click on the <em>home</em> directory, then <em>docs</em>, then <em>resumes</em>, and then drag <em>cv.tex</em> to the trash. Here you are experiencing the hierarchical nature of the system: <em>cv.tex</em> is a file inside the <em>resumes</em> directory, which is a subdirectory inside the <em>docs</em> directory, which is a subdirectory of the <em>home</em> directory.</p>
<p>Now suppose you can’t see your home directory on your screen. You would somehow need to make it appear on your screen. One way to do this is to navigate from what is called the <em>root</em> directory all the way to your home directory. Any filesystem will have what is called a <em>root</em> directory, which is the directory that contains all directories. The <em>home</em> directory shown in the figure above will usually be two or more levels from the root. On Windows, you will have a structure like this:</p>
<p><img src="productivity/img/unix/windows-filesystem-from-root.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p><img src="productivity/img/unix/windows-filesystem-from-root.png" width="70%" style="display: block; margin: auto;" /></p>
<p>while on the Mac, it will be like this:</p>
<p><img src="productivity/img/unix/mac-filesystem-from-root.png" width="500px" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p><img src="productivity/img/unix/mac-filesystem-from-root.png" width="70%" style="display: block; margin: auto;" /></p>
<p><strong>Note for Windows Users:</strong> The typical R installation will make your <em>Documents</em> directory your home directory in R. This will likely be different from your home directory in Git Bash. Generally, when we discuss home directories, we refer to the Unix home directory which for Windows, in this book, is the Git Bash Unix directory.</p>
</div>
<div id="working-directory" class="section level3 hasAnchor" number="38.3.3">
Expand Down Expand Up @@ -1219,7 +1219,7 @@ <h3><span class="header-section-number">38.4.3</span> <code>cd</code>: navigatin
<div id="some-examples" class="section level2 hasAnchor" number="38.5">
<h2><span class="header-section-number">38.5</span> Some examples<a href="unix.html#some-examples" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>Let’s explore some examples of using <code>cd</code>. To help visualize, we will show the graphical representation of our filesystem vertically:</p>
<p><img src="productivity/img/unix/filesystem-vertical.png" width="40%" style="display: block; margin-left: auto; margin-right: auto; background-color: #000; padding:3px;" style="display: block; margin: auto;" /></p>
<p><img src="productivity/img/unix/filesystem-vertical.png" width="40%" style="display: block; margin: auto;" /></p>
<p>Suppose our working directory is <code>~/projects</code> and we want to move to <code>figs</code> in <code>project-1</code>.</p>
<p>Here it is convenient to use relative paths:</p>
<div class="sourceCode" id="cb1421"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb1421-1"><a href="unix.html#cb1421-1" tabindex="-1"></a><span class="bu">cd</span> project-1/figs</span></code></pre></div>
Expand Down
4 changes: 2 additions & 2 deletions index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ knitr::write_bib(c(

This is the website for the first edition of Introduction to Data Science. **This book is now out-of-date**. We recommend using the second edition which is now divided into two parts:

* [Data Wrangling and Visualization with R](Statistics and Prediction Algorithms Through Case Studies).
* [Data Wrangling and Visualization with R](https://rafalab.dfci.harvard.edu/dsbook-part-1/).

* [Statistics and Prediction Algorithms Through Case Studies](Statistics and Prediction Algorithms Through Case Studies).
* [Statistics and Prediction Algorithms Through Case Studies](https://rafalab.dfci.harvard.edu/dsbook-part-2/).


# Preface for first edition {-}
Expand Down

0 comments on commit 7c02c7b

Please sign in to comment.