-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,736 additions
and
622 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# notes for package we installed | ||
|
||
- RMarkdown | ||
- here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
--- | ||
title: "Git Configuration" | ||
--- | ||
|
||
A short list of commands for git setup from the installation instructions | ||
and other settings to get goit working from the course | ||
|
||
Configure your git commit messages (User and Email) | ||
|
||
Use your email for github.com (not ubc github) | ||
|
||
``` | ||
git config --global user.name "" | ||
git config --global user.email "" | ||
``` | ||
|
||
SSH keys | ||
|
||
``` | ||
sudo systemctl enable teamviewerd | ||
``` | ||
|
||
Edit `~/.ssh/config` | ||
|
||
::: {.panel-tabset} | ||
|
||
## MacOS + *nix | ||
|
||
``` | ||
Host github.com | ||
AddKeysToAgent yes | ||
UseKeychain yes | ||
IdentityFile ~/.ssh/id_ed25519 | ||
Host github.ubc.ca | ||
AddKeysToAgent yes | ||
UseKeychain yes | ||
IdentityFile ~/.ssh/id_ed25519 | ||
``` | ||
|
||
|
||
## Git Bash (Windows) | ||
|
||
``` | ||
Host github.com | ||
AddKeysToAgent yes | ||
IdentityFile ~/.ssh/id_ed25519 | ||
Host github.ubc.ca | ||
AddKeysToAgent yes | ||
IdentityFile ~/.ssh/id_ed25519 | ||
``` | ||
::: | ||
|
||
|
||
Use your `~/.ssh/id_ed25519.pub` file and copy paste the contents to register your SSH key | ||
in **BOTH** the `github.com` and `github.ubc.ca` repositories | ||
|
||
## Git pull merge option | ||
|
||
If you push and try to pull with changes in the repote, | ||
you need to tell git how to reconsize the differences | ||
|
||
You may see this | ||
|
||
``` | ||
hint: You have divergent branches and need to specify how to reconcile them. | ||
hint: You can do so by running one of the following commands sometime before | ||
hint: your next pull: | ||
hint: | ||
hint: git config pull.rebase false # merge | ||
hint: git config pull.rebase true # rebase | ||
hint: git config pull.ff only # fast-forward only | ||
hint: | ||
hint: You can replace "git config" with "git config --global" to set a default | ||
hint: preference for all repositories. You can also pass --rebase, --no-rebase, | ||
hint: or --ff-only on the command line to override the configured default per | ||
hint: invocation. | ||
fatal: Need to specify how to reconcile divergent branches. | ||
``` | ||
|
||
We will use the old git default setting of `rebase false` (the first option). | ||
|
||
You can do this as a repo specific setting or as a global setting (add a `--global` flag) | ||
like you did with `user.name` and `user.email` | ||
|
||
- Repo setting: `git config pull.rebase false` | ||
- Global: `git config --global pull.rebase false` | ||
|
||
THen you can `pull` again, where you may or may not see a merge conflict. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: "RStudio Configuration" | ||
--- | ||
|
||
## Global Setup | ||
|
||
In the `Tools` > `Global Options` > `General` Tab, | ||
you want to uncheck the boxes that open previous files and projects, | ||
and also make sure that no `.RData` is saved when you quit RStudio, | ||
and to never save the `.RData` | ||
(this prevents RStudio from loading up previous data when you open it, | ||
it does not refer to its ability to load and save data as you use it). | ||
|
||
![](../lectures/img/rstudio-global_options-general.png) | ||
|
||
## LaTeX and XeLaTeX | ||
|
||
In the `Sweave` option | ||
|
||
change the `Sweave` option to `Knitr`, | ||
and `pdflatex` to `xelatex`. | ||
|
||
|
||
|
||
|
||
## Code snippets | ||
|
||
As we started to type `for` above, | ||
the code completion popped up | ||
and the first entry said "snippet", | ||
what is that? | ||
A code snippet is a text macro, | ||
which means that you can type a short string of characters | ||
to insert a template or snippet of text by pressing <kbd>TAB</kbd>. | ||
You can see all the default snippets | ||
and define your own by going to | ||
`Tools -> Global options -> Code -> Edit snippets`. | ||
Snippets are available anywhere in RStudio, | ||
not just in R Markdown documents. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
title: "Semantic Line Breaks" | ||
--- | ||
|
||
> Most documents go through several versions (always more than you expected) before they are finally finished. Accordingly, you should do whatever possible to make the job of changing them easy. | ||
> | ||
> First, when you do the purely mechanical operations of typing, type so subsequent editing will be easy. Start each sentence on a new line. Make lines short, and break lines at natural places, such as after commas and semicolons, rather than randomly. Since most people change documents by rewriting phrases and adding, deleting and rearranging sentences, these precautions simplify any editing you have to do later. | ||
> | ||
> — Brian W. Kernighan, 1974 [9] | ||
|
||
Semantic line breaks utilize how markdown treats line breaks and tries to combine it | ||
with regular prose text. | ||
You can read more about semantic line breaks here: <https://sembr.org/> | ||
|
||
Here are examples of how it works with markdown syntax | ||
|
||
|
||
```markdown | ||
this is a very long line that has over 80 characterslasdfja asldfja sljf lsd jflkadjsf | ||
``` | ||
|
||
is rendered as: | ||
|
||
this is a very long line that has over 80 characterslasdfja asldfja sljf lsd jflkadjsf | ||
|
||
|
||
```markdown | ||
this is a very long line that has | ||
over 80 characterslasdfja asldfja | ||
sljf lsd jflkadjsf | ||
``` | ||
|
||
is rendered as: | ||
|
||
this is a very long line that has | ||
over 80 characterslasdfja asldfja | ||
sljf lsd jflkadjsf | ||
|
||
|
||
### Add a line break | ||
|
||
Markdown allows 2 spaces at the end of a line for a line break | ||
|
||
```markdown | ||
this is a very long line that has<br/> | ||
over 80 characterslasdfja asldfja<br/> | ||
sljf lsd jflkadjsf | ||
``` | ||
|
||
this is a very long line that has<br/> | ||
over 80 characterslasdfja asldfja<br/> | ||
sljf lsd jflkadjsf | ||
|
||
Markdown also allows 2 spaces at the end of a line for a line break. | ||
THis may not work with many text editor options that strip trailing white space | ||
|
||
|
||
### Add an empty line for a paragraph break | ||
|
||
```markdown | ||
this is a very long line that has | ||
|
||
over 80 characterslasdfja asldfja | ||
|
||
sljf lsd jflkadjsf | ||
``` | ||
|
||
Rendered as: | ||
|
||
this is a very long line that has | ||
|
||
over 80 characterslasdfja asldfja | ||
|
||
sljf lsd jflkadjsf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
1. Create RProjects in Rstudio using `here` to define robust file paths. | ||
2. Detect the basic components of a dynamic document in Jupyter Notebooks and in R Markdown | ||
3. Explain markdown usage in relation to dynamic documents | ||
4. Differentiate between code chunks and code cells in Rmarkdown and Jupyter Notebooks. | ||
5. Select appropiate code chunk options for RMarkdown. | ||
6. Use semantic line breaks for version control files | ||
7. Specify metadata in the YAML header block | ||
1. Create RProjects in RStudio using `here` to define robust file paths. | ||
2. Detect the basic components of a dynamic document in Jupyter Notebooks and in R Markdown. | ||
3. Explain markdown usage in relation to dynamic documents. | ||
4. Differentiate between code chunks and code cells in RMarkdown and Jupyter Notebooks. | ||
5. Select appropriate code chunk options for RMarkdown. | ||
6. Use semantic line breaks for version control files. | ||
7. Specify metadata in the YAML header block. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.