-
Notifications
You must be signed in to change notification settings - Fork 153
/
first_observations.Rmd
71 lines (35 loc) · 2.65 KB
/
first_observations.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
title: "First observations"
---
With this tutorial, we have a working example website that we will explore together. We'll learn a few rules and look for patterns to get an understanding of what things do. And you can continue to use this website as a reference after the tutorial, along with [**RStudio's instructions for R Markdown websites**](http://rmarkdown.rstudio.com/rmarkdown_websites.html).
We'll start our exploration online looking at the website architecture, then we'll clone the repo to our local computers. Locally, we will explore further by going back and forth between the R Markdown editor and built webpages, and make modifications. Pushing to Github will make our modifications live!
----
## Exploring online
<br>
<!---this is an html comment that works in Markdown --->
<!--- I use the <br> html tag to force carriage returns in the text--->
### The website itself
This website has 5 pages:
- Home
- First Observations
- Basic Workflow
- Getting Sophisticated
- Your Turn
`github.io` means that there is a Github repo behind this website, and we also know the username and repo name:
**<http://jules32.github.io/rmarkdown-website-tutorial>** <=> **<https://github.com/jules32/rmarkdown-website-tutorial>**
(Note: you can have github websites point to different urls if you don't want the `github.io`.)
<br>
### The website's repo
Let's go to **<https://github.com/jules32/rmarkdown-website-tutorial>**.
**First, note the `gh-pages` branch** - this is critical for building free webpages. You can usually name branches whatever you want, but the `gh-pages` name means it can be built as a website. [I set it as my default branch](https://help.github.com/articles/setting-the-default-branch/).
![](images/gh-pages.png)
<br>
**Now let's look at the filenames**. We can recognize the names of the webpages we've seen, and there is also a `_site.yml` file, which is the website's configuration file. The simplest website possible would have 2 files only: `_site.yml` and `index.Rmd`
![](https://docs.google.com/drawings/d/1jnXfeJ3i-fwd-t49S5FyeMAX3cJSoCYbyZLLTqFZd7w/pub?w=960&h=720)
<br>
## Fork to your account, clone to your computer
Let's start digging deeper and playing with this.
1. Fork the [jules32/rmarkdown-website-tutorial](https://github.com/jules32/rmarkdown-website-tutorial) repo into your own account.
2. Edit the URL for the website by replacing `jules32` with your GitHub username
3. Clone to your local computer using RStudio (preferred) the [Desktop App](https://desktop.github.com/), or the command line.
![](https://docs.google.com/drawings/d/1yy2VFQy4QqxfOzt-XtTSNA91qoCI7jPo0ob7Pm89SBg/pub?w=960&h=720)