-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpart4.Rmd
254 lines (168 loc) · 4.5 KB
/
part4.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
---
title: "Command Line/Git & Version Control/Markdown/"
author: "Linda Wang"
date: "April 2023"
output:
ioslides_presentation:
incremental: false
css: style.css
self-included: true
widescreen: true
---
```{r, child=c('toc.md')}
```
# Basic Toolkit
[LDI Lab Toolkit](https://labordynamicsinstitute.github.io/ldilab-manual/02-03-toolkit.html)
- Command line
- Git
- Markdown
# Command Line/Git & Version Control/Markdown/
## Command Line
This slide is based on the [Carpentries tutorial on the Unix shell](https://swcarpentry.github.io/shell-novice/01-intro/index.html) (which you might want to do on your own).
- What is a command line and why use it?
- Graphical user interfaces are the most common way to give instruction to our computers. They are not good when we need to scale things up, do repetitive tasks, or have people reproduce instructions across systems.
- Command-line interfaces are another way to pass instructions to computers.
- "Shell" instructions can be scripted, allowing repetitive tasks to be done automatically and fast.
## Commands in the Unix Shell
- list files
```
$ ls
```
- moving around
- where are we (`pwd` = present working directory)
```
$ pwd
```
## Commands in the Unix Shell
- Create directories
```
$ mkdir somepath
```
## Commands in the Unix Shell
- change to where we want to be
```
$ cd somepath
$ pwd
$ cd ..
$ cd ./somepath
$ pwd
```
## Commands in the Unix Shell
- Move or rename files
```
$ mv somepath otherpath
```
- Copy (`cp`) files
```
$ cp test.do otherpath/
```
## Commands in the Unix Shell
- Remove (`rm`) files
```
$ rm filename.do
```
## Git
Version Control system. Track the progress in a project: what changes?, who made changes? [Again see the Carpentries tutorial](https://swcarpentry.github.io/git-novice/01-basics/index.html)
## Git and the command line
- Clone a repository
```
git clone https://github.com/labordynamicsinstitute/prettygood-example
```
(don't forget to change directory)
- Check where my local repository is vs. remote repository
```
git status
```
## Git and the command line
- Get the current version of an existing repository
```
git pull
```
## Git and the command line
- after making changes, how to reflect them in the external repository.
```
git add otherpath/fileimodified.do
git add otherpath/fileicreated.do
git commit -m "you write here a commit message"
git push
```
## Markdown
We use Markdown to write reports. [why?](https://carto.com/blog/why-we-use-markdown/)
- It's easy, fast, multi-platform, and it works great.
## Basic Syntax (https://www.markdownguide.org/basic-syntax/)
### Headings
```
# Heading level 1
## Heading level 2
### Heading level 3
#### Heading level 4
##### Heading level 5
```
---
### Lists
#### Ordered lists
```
1. First item
2. Second item
3. Third item
1. Indented item
2. Indented item
4. Fourth item
```
---
### Lists
#### Unordered lists
```
- First item
- Second item
- Third item
- Indented item
- Indented item
- Fourth item
```
---
### Blockquotes and Code Blocks
- Blockquotes
> This is a block quote, and it is created like this
```
> This is a block quote, and it is created like this
```
---
### Blockquotes and Code Blocks
- Code Block
Code embedded in the document:
```
"```"
gen var1= var2/var3
"```"
```
---
### Spacing
- Be sure to leave an empty line after a header.
```
### Bad example
#### U.S.Census Population Division
- Retrieved from https://www.census.gov/geographies/reference-files/2017/demo/popest/2017-fips.html
```
---
### Spacing
```
### Good example
#### U.S.Census Population Division
- Retrieved from https://www.census.gov/geographies/reference-files/2017/demo/popest/2017-fips.html
```
---
### Spacing
- Leave an empty line if you want to start a new paragraph.
```
Bad example:
Thank you for your replication archive.Blablabla.
**Conditional on making the requested changes to the manuscript and the openICPSR deposit prior to publication, the replication package is accepted.**
```
```
Good example:
Thank you for your replication archive. Blablabla.
**Conditional on making the requested changes to the manuscript and the openICPSR deposit prior to publication, the replication package is accepted.**
```
```{r, child=c('toc.md')}
```