23 |
--------------------------------------------------------------------------------
/_includes/carpentries.html:
--------------------------------------------------------------------------------
1 | {% comment %}
2 | General description of Software and Data Carpentry.
3 | {% endcomment %}
4 |
5 |
6 |
7 |
8 |
9 | Since 1998,
10 | Software Carpentry
11 | has been teaching researchers in science, engineering, medicine, and related disciplines
12 | the computing skills they need to get more done in less time and with less pain.
13 | Its volunteer instructors have run hundreds of events
14 | for thousands of learners in the past two and a half years.
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Data Carpentry develops and teaches workshops on the fundamental data skills needed to conduct research.
24 | Its target audience is researchers who have little to no prior computational experience,
25 | and its lessons are domain specific,
26 | building on learners' existing knowledge to enable them to quickly apply skills learned to their own research.
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | Library Carpentry is made by librarians to help librarians
36 | automate repetitive, boring, error-prone tasks;
37 | create, maintain and analyse sustainable and reusable data;
38 | work effectively with IT and systems colleagues;
39 | better understand the use of software in research;
40 | and much more.
41 | Library Carpentry was the winner of the 2016
42 | British Library Labs Teaching and Learning Award.
43 |
2 | Data Carpentry
3 | aims to help researchers get their work done
4 | in less time and with less pain
5 | by teaching them basic research computing skills.
6 | This hands-on workshop will cover basic concepts and tools,
7 | including program design, version control, data management,
8 | and task automation.
9 | Participants will be encouraged to help one another
10 | and to apply what they have learned to their own research problems.
11 |
2 | Who:
3 | The course is aimed at graduate students and other researchers.
4 |
5 | You don't need to have any previous knowledge of the tools
6 | that will be presented at the workshop.
7 |
8 |
9 |
--------------------------------------------------------------------------------
/_includes/episode_break.html:
--------------------------------------------------------------------------------
1 | {% comment %}
2 | Display a break's timings in a box similar to a learning episode's.
3 | {% endcomment %}
4 |
2 | Library Carpentry
3 | is made by librarians, for librarians to help you:
4 |
5 |
6 |
automate repetitive, boring, error-prone tasks
7 |
create, maintain and analyse sustainable and reusable data
8 |
work effectively with IT and systems colleagues
9 |
better understand the use of software in research
10 |
and much more...
11 |
12 |
13 |
14 | Library Carpentry introduces you to the fundamentals of computing
15 | and provides you with a platform for further self-directed learning.
16 | For more information on what we teach and why, please see our paper
17 | "Library Carpentry: software skills training for library professionals".
18 |
19 |
2 | Who:
3 | The course is for librarians, archivists, and other information workers.
4 |
5 | You don't need to have any previous knowledge of the tools that
6 | will be presented at the workshop.
7 |
8 |
2 | Software Carpentry
3 | aims to help researchers get their work done
4 | in less time and with less pain
5 | by teaching them basic research computing skills.
6 | This hands-on workshop will cover basic concepts and tools,
7 | including program design, version control, data management,
8 | and task automation.
9 | Participants will be encouraged to help one another
10 | and to apply what they have learned to their own research problems.
11 |
2 | Who:
3 | The course is aimed at graduate students and other researchers.
4 |
5 | You don't need to have any previous knowledge of the tools
6 | that will be presented at the workshop.
7 |
8 |
9 |
--------------------------------------------------------------------------------
/_includes/syllabus.html:
--------------------------------------------------------------------------------
1 | {% comment %}
2 | Display syllabus in tabular form.
3 | Days are displayed if at least one episode has 'start = true'.
4 | {% endcomment %}
5 |
23 | {% for episode in site.episodes %}
24 | {% if episode.start %} {% comment %} Starting a new day? {% endcomment %}
25 | {% assign day = day | plus: 1 %}
26 | {% if day > 1 %} {% comment %} If about to start day 2 or later, show finishing time for previous day {% endcomment %}
27 | {% assign hours = current | divided_by: 60 %}
28 | {% assign minutes = current | modulo: 60 %}
29 |
30 | {% if multiday %}
{% endif %}
31 |
{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}
32 |
Finish
33 |
34 |
35 | {% endif %}
36 | {% assign current = site.start_time %} {% comment %}Re-set start time of this episode to general daily start time {% endcomment %}
37 | {% endif %}
38 | {% assign hours = current | divided_by: 60 %}
39 | {% assign minutes = current | modulo: 60 %}
40 |
41 | {% if multiday %}
{% if episode.start %}Day {{ day }}{% endif %}
{% endif %}
42 |
{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}
{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}
69 |
Finish
70 |
71 |
72 |
73 |
74 |
75 | The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/_includes/workshop_ad.html:
--------------------------------------------------------------------------------
1 | {% comment %}
2 | Advertising box at the top of a workshop website home page.
3 | {% endcomment %}
4 |
5 |
6 |
7 |
{{page.venue}}
8 |
9 |
10 |
{{page.humandate}}
11 |
{% if page.humantime %}{{page.humantime}}{% endif %}
44 | {% include navbar.html %}
45 | {% include workshop_ad.html %}
46 | {{ content }}
47 | {% include workshop_footer.html %}
48 |
49 | {% include javascript.html %}
50 |
51 |
52 |
--------------------------------------------------------------------------------
/aio.md:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
29 | {% comment %}
30 | Create anchor for each one of the episodes.
31 | {% endcomment %}
32 | {% for episode in site.episodes %}
33 |
34 | {% endfor %}
35 |
--------------------------------------------------------------------------------
/assets/css/lesson.scss:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 | //----------------------------------------
5 | // Colors.
6 | //----------------------------------------
7 |
8 | // branding
9 | $color-brand: #2b3990 !default;
10 |
11 | // code boxes
12 | $color-error: #bd2c00 !default;
13 | $color-output: #303030 !default;
14 | $color-source: #6e5494 !default;
15 |
16 | // blockquotes
17 | $color-callout: #f4fd9c !default;
18 | $color-challenge: #eec275 !default;
19 | $color-checklist: #dfd2a0 !default;
20 | $color-discussion: #eec275 !default;
21 | $color-keypoints: #7ae78e !default;
22 | $color-objectives: #daee84 !default;
23 | $color-prereq: #9cd6dc !default;
24 | $color-solution: #ded4b9 !default;
25 | $color-testimonial: #fc8dc1 !default;
26 |
27 | //----------------------------------------
28 | // Specialized code blocks.
29 | //----------------------------------------
30 |
31 | @mixin cdSetup($color) {
32 | color: $color;
33 | border-left: solid 5px $color;
34 | margin-bottom: 0px;
35 | border-radius: 4px 0 0 4px;
36 | }
37 |
38 | .error { @include cdSetup($color-error); }
39 | .output { @include cdSetup($color-output); }
40 | .source { @include cdSetup($color-source); }
41 |
42 | .bash, .language-bash { @include cdSetup($color-source); }
43 | .make, .language-make { @include cdSetup($color-source); }
44 | .matlab, .language-matlab { @include cdSetup($color-source); }
45 | .python, .language-python { @include cdSetup($color-source); }
46 | .r, .language-r { @include cdSetup($color-source); }
47 | .sql, .langauge-sql { @include cdSetup($color-source); }
48 |
49 | .error pre,
50 | .output pre,
51 | .source pre,
52 | .bash pre,
53 | .language-bash pre,
54 | .make pre,
55 | .language-make pre,
56 | .matlab pre,
57 | .language-matlab pre,
58 | .python pre,
59 | .language-python pre,
60 | .r pre,
61 | .language-r pre,
62 | .sql pre ,
63 | .language-sql pre {
64 | border-radius: 0 4px 4px 0;
65 | }
66 |
67 | //----------------------------------------
68 | // Specialized blockquote environments for learning objectives, callouts, etc.
69 | //----------------------------------------
70 |
71 | $codeblock-padding: 5px !default;
72 |
73 | @mixin bkSetup($color, $glyph) {
74 |
75 | $gradientcolor1: $color;
76 | $gradientcolor2: scale-color($color, $lightness: 10%);
77 |
78 | padding-left: $codeblock-padding;
79 | padding-top: 0;
80 | padding-bottom: 0;
81 | padding-right: 0;
82 | border: 1px solid;
83 | border-color: $color;
84 | padding-bottom: $codeblock-padding;
85 |
86 | h2 {
87 | padding-top: $codeblock-padding;
88 | padding-bottom: $codeblock-padding;
89 | font-size: 20px;
90 | background: linear-gradient(to bottom, $gradientcolor1, $gradientcolor2);
91 | border-color: $color;
92 | margin-top: 0px;
93 | margin-left: -$codeblock-padding; // to move back to the left margin of the enclosing blockquote
94 | }
95 | h2:before {
96 | font-family: 'Glyphicons Halflings';
97 | content: $glyph;
98 | float: left;
99 | padding-left: $codeblock-padding;
100 | padding-right: $codeblock-padding;
101 | display: inline-block;
102 | -webkit-font-smoothing: antialiased;
103 | }
104 |
105 | }
106 |
107 | .callout{ @include bkSetup($color-callout, "\e146"); }
108 | .challenge{ @include bkSetup($color-challenge, "\270f"); }
109 | .checklist{ @include bkSetup($color-checklist, "\e067"); }
110 | .discussion{ @include bkSetup($color-discussion, "\e123"); }
111 | .keypoints{ @include bkSetup($color-keypoints, "\e101"); }
112 | .objectives{ @include bkSetup($color-objectives, "\e085"); }
113 | .prereq{ @include bkSetup($color-prereq, "\e124"); }
114 | .solution{ @include bkSetup($color-solution, "\e105"); }
115 | .testimonial{ @include bkSetup($color-testimonial, "\e143"); }
116 |
117 | .callout h3,
118 | .challenge h3,
119 | .checklist h3,
120 | .discussion h3,
121 | .keypoints h3,
122 | .objectives h3,
123 | .prereq h3,
124 | .solution h3,
125 | .testimonial h3 {
126 | font-size: 18px;
127 | }
128 |
129 | //----------------------------------------
130 | // Override Bootstrap settings.
131 | //----------------------------------------
132 |
133 | code {
134 | white-space: nowrap;
135 | padding: 2px 5px;
136 | color: #3d90d9;
137 | background-color: #e7e7e7;
138 | }
139 |
140 | img {
141 | max-width: 100%;
142 | }
143 |
144 | //----------------------------------------
145 | // Miscellaneous.
146 | //----------------------------------------
147 |
148 | .maintitle {
149 | text-align: center;
150 | }
151 |
152 | .footertext {
153 | text-align: center;
154 | }
155 |
156 | footer .copyright,
157 | footer .help-links
158 | {
159 | font-size: 18px;
160 | margin-top: 10px;
161 | margin-bottom: 10px;
162 | font-weight: 500;
163 | line-height: 1.1;
164 | }
165 |
166 | img.navbar-logo {
167 | height: 40px; // synchronize with height of navbar
168 | padding-top: 5px;
169 | padding-right: 10px;
170 | }
171 |
172 | div.branding {
173 | color: $color-brand;
174 | }
175 |
176 | ul,
177 | ol {
178 | padding-left: 2em;
179 | }
180 |
181 | span.fold-unfold {
182 | margin-left: 1em;
183 | opacity: 0.5;
184 | }
185 |
186 |
187 | //----------------------------------------
188 | // keyboard key style, from StackExchange.
189 | //----------------------------------------
190 |
191 | kbd {
192 | display: inline-block;
193 | margin: 0 .1em;
194 | padding: .1em .6em;
195 | font-family: Arial,"Helvetica Neue",Helvetica,sans-serif;
196 | font-size: 11px;
197 | line-height: 1.4;
198 | color: #242729;
199 | text-shadow: 0 1px 0 #FFF;
200 | background-color: #e1e3e5;
201 | border: 1px solid #adb3b9;
202 | border-radius: 3px;
203 | box-shadow: 0 1px 0 rgba(12,13,14,0.2), 0 0 0 2px #FFF inset;
204 | white-space: nowrap;
205 | font-style: normal;
206 | }
207 |
--------------------------------------------------------------------------------
/assets/css/syntax.css:
--------------------------------------------------------------------------------
1 | .highlight .hll { background-color: #ffffcc }
2 | .highlight { background: #f8f8f8; }
3 | .highlight .c { color: #408080; font-style: italic } /* Comment */
4 | .highlight .err { border: 1px solid #FF0000 } /* Error */
5 | .highlight .k { color: #008000; font-weight: bold } /* Keyword */
6 | .highlight .o { color: #666666 } /* Operator */
7 | .highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
8 | .highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
9 | .highlight .cp { color: #BC7A00 } /* Comment.Preproc */
10 | .highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
11 | .highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
12 | .highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */
14 | .highlight .ge { font-style: italic } /* Generic.Emph */
15 | .highlight .gr { color: #FF0000 } /* Generic.Error */
16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */
18 | .highlight .go { color: #888888 } /* Generic.Output */
19 | .highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
20 | .highlight .gs { font-weight: bold } /* Generic.Strong */
21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */
23 | .highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
24 | .highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
25 | .highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
26 | .highlight .kp { color: #008000 } /* Keyword.Pseudo */
27 | .highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
28 | .highlight .kt { color: #B00040 } /* Keyword.Type */
29 | .highlight .m { color: #666666 } /* Literal.Number */
30 | .highlight .s { color: #BA2121 } /* Literal.String */
31 | .highlight .na { color: #7D9029 } /* Name.Attribute */
32 | .highlight .nb { color: #008000 } /* Name.Builtin */
33 | .highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
34 | .highlight .no { color: #880000 } /* Name.Constant */
35 | .highlight .nd { color: #AA22FF } /* Name.Decorator */
36 | .highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
37 | .highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
38 | .highlight .nf { color: #0000FF } /* Name.Function */
39 | .highlight .nl { color: #A0A000 } /* Name.Label */
40 | .highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
41 | .highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
42 | .highlight .nv { color: #19177C } /* Name.Variable */
43 | .highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */
45 | .highlight .mb { color: #666666 } /* Literal.Number.Bin */
46 | .highlight .mf { color: #666666 } /* Literal.Number.Float */
47 | .highlight .mh { color: #666666 } /* Literal.Number.Hex */
48 | .highlight .mi { color: #666666 } /* Literal.Number.Integer */
49 | .highlight .mo { color: #666666 } /* Literal.Number.Oct */
50 | .highlight .sa { color: #BA2121 } /* Literal.String.Affix */
51 | .highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
52 | .highlight .sc { color: #BA2121 } /* Literal.String.Char */
53 | .highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */
54 | .highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
55 | .highlight .s2 { color: #BA2121 } /* Literal.String.Double */
56 | .highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
57 | .highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
58 | .highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
59 | .highlight .sx { color: #008000 } /* Literal.String.Other */
60 | .highlight .sr { color: #BB6688 } /* Literal.String.Regex */
61 | .highlight .s1 { color: #BA2121 } /* Literal.String.Single */
62 | .highlight .ss { color: #19177C } /* Literal.String.Symbol */
63 | .highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
64 | .highlight .fm { color: #0000FF } /* Name.Function.Magic */
65 | .highlight .vc { color: #19177C } /* Name.Variable.Class */
66 | .highlight .vg { color: #19177C } /* Name.Variable.Global */
67 | .highlight .vi { color: #19177C } /* Name.Variable.Instance */
68 | .highlight .vm { color: #19177C } /* Name.Variable.Magic */
69 | .highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
70 |
--------------------------------------------------------------------------------
/assets/favicons/cp/apple-touch-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/apple-touch-icon-114x114.png
--------------------------------------------------------------------------------
/assets/favicons/cp/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/assets/favicons/cp/apple-touch-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/apple-touch-icon-144x144.png
--------------------------------------------------------------------------------
/assets/favicons/cp/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/assets/favicons/cp/apple-touch-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/apple-touch-icon-57x57.png
--------------------------------------------------------------------------------
/assets/favicons/cp/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/assets/favicons/cp/apple-touch-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/apple-touch-icon-72x72.png
--------------------------------------------------------------------------------
/assets/favicons/cp/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/assets/favicons/cp/favicon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/favicon-128.png
--------------------------------------------------------------------------------
/assets/favicons/cp/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/favicon-16x16.png
--------------------------------------------------------------------------------
/assets/favicons/cp/favicon-196x196.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/favicon-196x196.png
--------------------------------------------------------------------------------
/assets/favicons/cp/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/favicon-32x32.png
--------------------------------------------------------------------------------
/assets/favicons/cp/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/favicon-96x96.png
--------------------------------------------------------------------------------
/assets/favicons/cp/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/favicon.ico
--------------------------------------------------------------------------------
/assets/favicons/cp/mstile-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/mstile-144x144.png
--------------------------------------------------------------------------------
/assets/favicons/cp/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/mstile-150x150.png
--------------------------------------------------------------------------------
/assets/favicons/cp/mstile-310x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/mstile-310x150.png
--------------------------------------------------------------------------------
/assets/favicons/cp/mstile-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/mstile-310x310.png
--------------------------------------------------------------------------------
/assets/favicons/cp/mstile-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/cp/mstile-70x70.png
--------------------------------------------------------------------------------
/assets/favicons/dc/apple-touch-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/apple-touch-icon-114x114.png
--------------------------------------------------------------------------------
/assets/favicons/dc/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/assets/favicons/dc/apple-touch-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/apple-touch-icon-144x144.png
--------------------------------------------------------------------------------
/assets/favicons/dc/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/assets/favicons/dc/apple-touch-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/apple-touch-icon-57x57.png
--------------------------------------------------------------------------------
/assets/favicons/dc/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/assets/favicons/dc/apple-touch-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/apple-touch-icon-72x72.png
--------------------------------------------------------------------------------
/assets/favicons/dc/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/assets/favicons/dc/favicon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/favicon-128.png
--------------------------------------------------------------------------------
/assets/favicons/dc/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/favicon-16x16.png
--------------------------------------------------------------------------------
/assets/favicons/dc/favicon-196x196.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/favicon-196x196.png
--------------------------------------------------------------------------------
/assets/favicons/dc/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/favicon-32x32.png
--------------------------------------------------------------------------------
/assets/favicons/dc/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/favicon-96x96.png
--------------------------------------------------------------------------------
/assets/favicons/dc/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/favicon.ico
--------------------------------------------------------------------------------
/assets/favicons/dc/mstile-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/mstile-144x144.png
--------------------------------------------------------------------------------
/assets/favicons/dc/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/mstile-150x150.png
--------------------------------------------------------------------------------
/assets/favicons/dc/mstile-310x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/mstile-310x150.png
--------------------------------------------------------------------------------
/assets/favicons/dc/mstile-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/mstile-310x310.png
--------------------------------------------------------------------------------
/assets/favicons/dc/mstile-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/dc/mstile-70x70.png
--------------------------------------------------------------------------------
/assets/favicons/lc/apple-touch-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/apple-touch-icon-114x114.png
--------------------------------------------------------------------------------
/assets/favicons/lc/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/assets/favicons/lc/apple-touch-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/apple-touch-icon-144x144.png
--------------------------------------------------------------------------------
/assets/favicons/lc/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/assets/favicons/lc/apple-touch-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/apple-touch-icon-57x57.png
--------------------------------------------------------------------------------
/assets/favicons/lc/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/assets/favicons/lc/apple-touch-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/apple-touch-icon-72x72.png
--------------------------------------------------------------------------------
/assets/favicons/lc/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/assets/favicons/lc/favicon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/favicon-128.png
--------------------------------------------------------------------------------
/assets/favicons/lc/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/favicon-16x16.png
--------------------------------------------------------------------------------
/assets/favicons/lc/favicon-196x196.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/favicon-196x196.png
--------------------------------------------------------------------------------
/assets/favicons/lc/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/favicon-32x32.png
--------------------------------------------------------------------------------
/assets/favicons/lc/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/favicon-96x96.png
--------------------------------------------------------------------------------
/assets/favicons/lc/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/favicon.ico
--------------------------------------------------------------------------------
/assets/favicons/lc/mstile-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/mstile-144x144.png
--------------------------------------------------------------------------------
/assets/favicons/lc/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/mstile-150x150.png
--------------------------------------------------------------------------------
/assets/favicons/lc/mstile-310x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/mstile-310x150.png
--------------------------------------------------------------------------------
/assets/favicons/lc/mstile-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/mstile-310x310.png
--------------------------------------------------------------------------------
/assets/favicons/lc/mstile-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/lc/mstile-70x70.png
--------------------------------------------------------------------------------
/assets/favicons/swc/apple-touch-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/apple-touch-icon-114x114.png
--------------------------------------------------------------------------------
/assets/favicons/swc/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/assets/favicons/swc/apple-touch-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/apple-touch-icon-144x144.png
--------------------------------------------------------------------------------
/assets/favicons/swc/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/assets/favicons/swc/apple-touch-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/apple-touch-icon-57x57.png
--------------------------------------------------------------------------------
/assets/favicons/swc/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/assets/favicons/swc/apple-touch-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/apple-touch-icon-72x72.png
--------------------------------------------------------------------------------
/assets/favicons/swc/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/assets/favicons/swc/favicon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/favicon-128.png
--------------------------------------------------------------------------------
/assets/favicons/swc/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/favicon-16x16.png
--------------------------------------------------------------------------------
/assets/favicons/swc/favicon-196x196.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/favicon-196x196.png
--------------------------------------------------------------------------------
/assets/favicons/swc/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/favicon-32x32.png
--------------------------------------------------------------------------------
/assets/favicons/swc/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/favicon-96x96.png
--------------------------------------------------------------------------------
/assets/favicons/swc/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/favicon.ico
--------------------------------------------------------------------------------
/assets/favicons/swc/mstile-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/mstile-144x144.png
--------------------------------------------------------------------------------
/assets/favicons/swc/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/mstile-150x150.png
--------------------------------------------------------------------------------
/assets/favicons/swc/mstile-310x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/mstile-310x150.png
--------------------------------------------------------------------------------
/assets/favicons/swc/mstile-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/mstile-310x310.png
--------------------------------------------------------------------------------
/assets/favicons/swc/mstile-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/favicons/swc/mstile-70x70.png
--------------------------------------------------------------------------------
/assets/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/assets/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/assets/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/assets/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/assets/img/cp-logo-blue.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/img/dc-icon-black.svg:
--------------------------------------------------------------------------------
1 |
2 |
75 |
--------------------------------------------------------------------------------
/assets/img/dc-logo-black.svg:
--------------------------------------------------------------------------------
1 |
2 |
75 |
--------------------------------------------------------------------------------
/assets/img/lc-icon-black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/img/lc-icon-black.png
--------------------------------------------------------------------------------
/assets/img/lc-logo-black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/img/lc-logo-black.png
--------------------------------------------------------------------------------
/assets/img/swc-icon-blue.svg:
--------------------------------------------------------------------------------
1 |
2 |
71 |
--------------------------------------------------------------------------------
/assets/img/swc-logo-blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/img/swc-logo-blue.png
--------------------------------------------------------------------------------
/assets/img/swc-logo-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/assets/img/swc-logo-white.png
--------------------------------------------------------------------------------
/assets/js/lesson.js:
--------------------------------------------------------------------------------
1 | // Make all tables striped by default.
2 | $("table").addClass("table table-striped");
3 |
4 |
5 | // Handle foldable challenges and solutions (on click and at start).
6 | $(".solution").click(function(event) {
7 | var trigger = $(event.target).has(".fold-unfold").size() > 0
8 | || $(event.target).filter(".fold-unfold").size() > 0;
9 | if (trigger) {
10 | $(">*:not(h2)", this).toggle(400);
11 | $(">h2>span.fold-unfold", this).toggleClass("glyphicon-collapse-down glyphicon-collapse-up");
12 | event.stopPropagation();
13 | }
14 | });
15 | $(".solution").each(function() {
16 | $(">*:not(h2)", this).toggle();
17 | var h2 = $("h2:first", this);
18 | h2.append("");
19 | });
20 |
21 |
22 | // Handle searches.
23 | // Relies on document having 'meta' element with name 'search-domain'.
24 | function google_search() {
25 | var query = document.getElementById("google-search").value;
26 | var domain = $("meta[name=search-domain]").attr("value");
27 | window.open("https://www.google.com/search?q=" + query + "+site:" + domain);
28 | }
29 |
--------------------------------------------------------------------------------
/bin/boilerplate/.travis.yml:
--------------------------------------------------------------------------------
1 | # dist: trusty # Ubuntu 14.04
2 | language: python
3 | python: 3.6
4 | branches:
5 | only:
6 | - gh-pages
7 | - /.*/
8 | before_install:
9 | - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
10 | - echo "deb https://cran.rstudio.com/bin/linux/ubuntu trusty/" | sudo tee -a /etc/apt/sources.list
11 | - sudo apt-get update -y
12 | - sudo apt-get install -y r-base
13 | - sudo Rscript -e "install.packages('knitr', repos = 'https://', dependencies = TRUE)"
14 | - sudo Rscript -e "install.packages('stringr', repos = 'https://cran.rstudio.com', dependencies = TRUE)"
15 | - sudo Rscript -e "install.packages('checkpoint', repos = 'https://cran.rstudio.com', dependencies = TRUE)"
16 | - sudo Rscript -e "install.packages('ggplot2', repos = 'https://cran.rstudio.com', dependencies = TRUE)"
17 | - rvm default
18 | - gem install json kramdown jekyll
19 | install:
20 | - pip install pyyaml
21 | script:
22 | - make lesson-check-all
23 | - make --always-make site
24 |
--------------------------------------------------------------------------------
/bin/boilerplate/AUTHORS:
--------------------------------------------------------------------------------
1 | FIXME: list authors' names and email addresses.
--------------------------------------------------------------------------------
/bin/boilerplate/CITATION:
--------------------------------------------------------------------------------
1 | FIXME: describe how to cite this lesson.
--------------------------------------------------------------------------------
/bin/boilerplate/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: "Contributor Code of Conduct"
4 | ---
5 | As contributors and maintainers of this project,
6 | we pledge to follow the [Carpentry Code of Conduct][coc].
7 |
8 | Instances of abusive, harassing, or otherwise unacceptable behavior
9 | may be reported by following our [reporting guidelines][coc-reporting].
10 |
11 | {% include links.md %}
12 |
--------------------------------------------------------------------------------
/bin/boilerplate/README.md:
--------------------------------------------------------------------------------
1 | # FIXME Lesson title
2 |
3 | [](https://swc-slack-invite.herokuapp.com/)
4 |
5 | FIXME
6 |
7 | ## Contributing
8 |
9 | We welcome all contributions to improve the lesson! Maintainers will do their best to help you if you have any
10 | questions, concerns, or experience any difficulties along the way.
11 |
12 | We'd like to ask you to familiarize yourself with our [Contribution Guide](CONTRIBUTING.md) and have a look at
13 | the [more detailed guidelines][lesson-example] on proper formatting, ways to render the lesson locally, and even
14 | how to write new episodes.
15 |
16 | ## Maintainer(s)
17 |
18 | * FIXME
19 |
20 | ## Authors
21 |
22 | A list of contributors to the lesson can be found in [AUTHORS](AUTHORS)
23 |
24 | ## Citation
25 |
26 | To cite this lesson, please consult with [CITATION](CITATION)
27 |
28 | [lesson-example]: https://carpentries.github.io/lesson-example
29 |
--------------------------------------------------------------------------------
/bin/boilerplate/_config.yml:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------
2 | # Values for this lesson.
3 | #------------------------------------------------------------
4 |
5 | # Which carpentry is this ("swc", "dc", "lc", or "cp")?
6 | # swc: Software Carpentry
7 | # dc: Data Carpentry
8 | # lc: Library Carpentry
9 | # cp: Carpentries (to use for instructor traning for instance)
10 | carpentry: "swc"
11 |
12 | # Overall title for pages.
13 | title: "Lesson Title"
14 |
15 | #------------------------------------------------------------
16 | # Generic settings (should not need to change).
17 | #------------------------------------------------------------
18 |
19 | # What kind of thing is this ("workshop" or "lesson")?
20 | kind: "lesson"
21 |
22 | # Magic to make URLs resolve both locally and on GitHub.
23 | # See https://help.github.com/articles/repository-metadata-on-github-pages/.
24 | # Please don't change it: / is correct.
25 | repository: /
26 |
27 | # Email address, no mailto:
28 | email: "team@carpentries.org"
29 |
30 | # Sites.
31 | amy_site: "https://amy.software-carpentry.org/workshops"
32 | carpentries_github: "https://github.com/carpentries"
33 | carpentries_pages: "https://carpentries.github.io"
34 | carpentries_site: "https://carpentries.org/"
35 | dc_site: "http://datacarpentry.org"
36 | example_repo: "https://github.com/carpentries/lesson-example"
37 | example_site: "https://carpentries.github.io/lesson-example"
38 | lc_site: "https://librarycarpentry.github.io/"
39 | swc_github: "https://github.com/swcarpentry"
40 | swc_pages: "https://swcarpentry.github.io"
41 | swc_site: "https://software-carpentry.org"
42 | template_repo: "https://github.com/carpentries/styles"
43 | training_site: "https://carpentries.github.io/instructor-training"
44 | workshop_repo: "https://github.com/carpentries/workshop-template"
45 | workshop_site: "https://carpentries.github.io/workshop-template"
46 |
47 | # Surveys.
48 | pre_survey: "https://www.surveymonkey.com/r/swc_pre_workshop_v1?workshop_id="
49 | post_survey: "https://www.surveymonkey.com/r/swc_post_workshop_v1?workshop_id="
50 | training_post_survey: "https://www.surveymonkey.com/r/post-instructor-training"
51 |
52 | # Start time in minutes (0 to be clock-independent, 540 to show a start at 09:00 am).
53 | start_time: 0
54 |
55 | # Specify that things in the episodes collection should be output.
56 | collections:
57 | episodes:
58 | output: true
59 | permalink: /:path/index.html
60 | extras:
61 | output: true
62 | permalink: /:path/index.html
63 |
64 | # Set the default layout for things in the episodes collection.
65 | defaults:
66 | - values:
67 | root: .
68 | layout: page
69 | - scope:
70 | path: ""
71 | type: episodes
72 | values:
73 | root: ..
74 | layout: episode
75 | - scope:
76 | path: ""
77 | type: extras
78 | values:
79 | root: ..
80 | layout: page
81 |
82 | # Files and directories that are not to be copied.
83 | exclude:
84 | - Makefile
85 | - bin/
86 | - .Rproj.user/
87 |
88 | # Turn on built-in syntax highlighting.
89 | highlighter: rouge
90 |
--------------------------------------------------------------------------------
/bin/boilerplate/_episodes/01-introduction.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Introduction"
3 | teaching: 0
4 | exercises: 0
5 | questions:
6 | - "Key question (FIXME)"
7 | objectives:
8 | - "First objective. (FIXME)"
9 | keypoints:
10 | - "First key point. (FIXME)"
11 | ---
12 | FIXME
13 |
14 | {% include links.md %}
15 |
--------------------------------------------------------------------------------
/bin/boilerplate/_extras/about.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: About
3 | ---
4 | {% include carpentries.html %}
5 | {% include links.md %}
6 |
--------------------------------------------------------------------------------
/bin/boilerplate/_extras/discuss.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Discussion
3 | ---
4 | FIXME
5 |
6 | {% include links.md %}
7 |
--------------------------------------------------------------------------------
/bin/boilerplate/_extras/figures.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Figures
3 | ---
4 |
33 | {% comment %}
34 | Create anchor for each one of the episodes.
35 | {% endcomment %}
36 | {% for episode in site.episodes %}
37 |
38 | {% endfor %}
39 |
40 | {% include links.md %}
41 |
--------------------------------------------------------------------------------
/bin/boilerplate/_extras/guide.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Instructor Notes"
3 | ---
4 | FIXME
5 |
6 | {% include links.md %}
7 |
--------------------------------------------------------------------------------
/bin/boilerplate/aio.md:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
29 | {% comment %}
30 | Create anchor for each one of the episodes.
31 | {% endcomment %}
32 | {% for episode in site.episodes %}
33 |
34 | {% endfor %}
35 |
--------------------------------------------------------------------------------
/bin/boilerplate/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: lesson
3 | root: . # Is the only page that don't follow the partner /:path/index.html
4 | permalink: index.html # Is the only page that don't follow the partner /:path/index.html
5 | ---
6 | FIXME: home page introduction
7 |
8 | > ## Prerequisites
9 | >
10 | > FIXME
11 | {: .prereq}
12 |
13 | {% include links.md %}
14 |
--------------------------------------------------------------------------------
/bin/boilerplate/reference.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: reference
3 | ---
4 |
5 | ## Glossary
6 |
7 | FIXME
8 |
9 | {% include links.md %}
10 |
--------------------------------------------------------------------------------
/bin/boilerplate/setup.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Setup
3 | ---
4 | FIXME
5 |
6 |
7 | {% include links.md %}
8 |
--------------------------------------------------------------------------------
/bin/chunk-options.R:
--------------------------------------------------------------------------------
1 | # These settings control the behavior of all chunks in the novice R materials.
2 | # For example, to generate the lessons with all the output hidden, simply change
3 | # `results` from "markup" to "hide".
4 | # For more information on available chunk options, see
5 | # http://yihui.name/knitr/options#chunk_options
6 |
7 | library("knitr")
8 |
9 | fix_fig_path <- function(pth) file.path("..", pth)
10 |
11 |
12 | ## We set the path for the figures globally below, so if we want to
13 | ## customize it for individual episodes, we can append a prefix to the
14 | ## global path. For instance, if we call knitr_fig_path("01-") in the
15 | ## first episode of the lesson, it will generate the figures in
16 | ## `fig/rmd-01-`
17 | knitr_fig_path <- function(prefix) {
18 | new_path <- paste0(opts_chunk$get("fig.path"),
19 | prefix)
20 | opts_chunk$set(fig.path = new_path)
21 | }
22 |
23 | ## We use the rmd- prefix for the figures generated by the lssons so
24 | ## they can be easily identified and deleted by `make clean-rmd`. The
25 | ## working directory when the lessons are generated is the root so the
26 | ## figures need to be saved in fig/, but when the site is generated,
27 | ## the episodes will be one level down. We fix the path using the
28 | ## `fig.process` option.
29 |
30 | opts_chunk$set(tidy = FALSE, results = "markup", comment = NA,
31 | fig.align = "center", fig.path = "fig/rmd-",
32 | fig.process = fix_fig_path)
33 |
34 | # The hooks below add html tags to the code chunks and their output so that they
35 | # are properly formatted when the site is built.
36 |
37 | hook_in <- function(x, options) {
38 | stringr::str_c("\n\n~~~\n",
39 | paste0(x, collapse="\n"),
40 | "\n~~~\n{: .language-r}\n\n")
41 | }
42 |
43 | hook_out <- function(x, options) {
44 | x <- gsub("\n$", "", x)
45 | stringr::str_c("\n\n~~~\n",
46 | paste0(x, collapse="\n"),
47 | "\n~~~\n{: .output}\n\n")
48 | }
49 |
50 | hook_error <- function(x, options) {
51 | x <- gsub("\n$", "", x)
52 | stringr::str_c("\n\n~~~\n",
53 | paste0(x, collapse="\n"),
54 | "\n~~~\n{: .error}\n\n")
55 | }
56 |
57 | knit_hooks$set(source = hook_in, output = hook_out, warning = hook_error,
58 | error = hook_error, message = hook_out)
59 |
--------------------------------------------------------------------------------
/bin/generate_md_episodes.R:
--------------------------------------------------------------------------------
1 | generate_md_episodes <- function() {
2 |
3 | library("methods")
4 |
5 | if (require("knitr") && packageVersion("knitr") < '1.9.19')
6 | stop("knitr must be version 1.9.20 or higher")
7 |
8 | if (!require("stringr"))
9 | stop("The package stringr is required for generating the lessons.")
10 |
11 | if (require("checkpoint") && packageVersion("checkpoint") >= '0.4.0') {
12 | required_pkgs <-
13 | checkpoint:::scanForPackages(project = "_episodes_rmd",
14 | verbose=FALSE, use.knitr = TRUE)$pkgs
15 | } else {
16 | stop("The checkpoint package (>= 0.4.0) is required to build the lessons.")
17 | }
18 |
19 | missing_pkgs <- required_pkgs[!(required_pkgs %in% rownames(installed.packages()))]
20 |
21 | if (length(missing_pkgs)) {
22 | message("Installing missing required packages: ",
23 | paste(missing_pkgs, collapse=", "))
24 | install.packages(missing_pkgs)
25 | }
26 |
27 | ## find all the Rmd files, and generate the paths for their respective outputs
28 | src_rmd <- list.files(pattern = "??-*.Rmd$", path = "_episodes_rmd", full.names = TRUE)
29 | dest_md <- file.path("_episodes", gsub("Rmd$", "md", basename(src_rmd)))
30 |
31 | ## knit the Rmd into markdown
32 | mapply(function(x, y) {
33 | knitr::knit(x, output = y)
34 | }, src_rmd, dest_md)
35 |
36 | # Read the generated md files and add comments advising not to edit them
37 | vapply(dest_md, function(y) {
38 | con <- file(y)
39 | mdfile <- readLines(con)
40 | if (mdfile[1] != "---")
41 | stop("Input file does not have a valid header")
42 | mdfile <- append(mdfile, "# Please do not edit this file directly; it is auto generated.", after = 1)
43 | mdfile <- append(mdfile, paste("# Instead, please edit",
44 | basename(y), "in _episodes_rmd/"), after = 2)
45 | writeLines(mdfile, con)
46 | close(con)
47 | return(paste("Warning added to YAML header of", y))
48 | },
49 | character(1))
50 | }
51 |
52 | generate_md_episodes()
53 |
--------------------------------------------------------------------------------
/bin/knit_lessons.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Only try running R to translate files if there are some files present.
4 | # The Makefile passes in the names of files.
5 |
6 | if [ $# -ne 0 ] ; then
7 | Rscript -e "source('bin/generate_md_episodes.R')"
8 | fi
9 |
--------------------------------------------------------------------------------
/bin/lesson_initialize.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | """Initialize a newly-created repository."""
4 |
5 |
6 | import sys
7 | import os
8 | import shutil
9 |
10 | BOILERPLATE = (
11 | '.travis.yml',
12 | 'AUTHORS',
13 | 'CITATION',
14 | 'CODE_OF_CONDUCT.md',
15 | 'CONTRIBUTING.md',
16 | 'README.md',
17 | '_config.yml',
18 | '_episodes/01-introduction.md',
19 | '_extras/about.md',
20 | '_extras/discuss.md',
21 | '_extras/figures.md',
22 | '_extras/guide.md',
23 | 'aio.md',
24 | 'index.md',
25 | 'reference.md',
26 | 'setup.md',
27 | )
28 |
29 |
30 | def main():
31 | """Check for collisions, then create."""
32 |
33 | # Check.
34 | errors = False
35 | for path in BOILERPLATE:
36 | if os.path.exists(path):
37 | print('Warning: {0} already exists.'.format(path), file=sys.stderr)
38 | errors = True
39 | if errors:
40 | print('**Exiting without creating files.**', file=sys.stderr)
41 | sys.exit(1)
42 |
43 | # Create.
44 | for path in BOILERPLATE:
45 | shutil.copyfile(
46 | "bin/boilerplate/{}".format(path),
47 | path
48 | )
49 |
50 |
51 | if __name__ == '__main__':
52 | main()
53 |
--------------------------------------------------------------------------------
/bin/markdown_ast.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # Use Kramdown parser to produce AST for Markdown document.
4 |
5 | require "kramdown"
6 | require "json"
7 |
8 | markdown = STDIN.read()
9 | doc = Kramdown::Document.new(markdown)
10 | tree = doc.to_hash_a_s_t
11 | puts JSON.pretty_generate(tree)
12 |
--------------------------------------------------------------------------------
/bin/repo_check.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | """
4 | Check repository settings.
5 | """
6 |
7 |
8 | import sys
9 | import os
10 | from subprocess import Popen, PIPE
11 | import re
12 | from argparse import ArgumentParser
13 |
14 | from util import Reporter, require
15 |
16 | # Import this way to produce a more useful error message.
17 | try:
18 | import requests
19 | except ImportError:
20 | print('Unable to import requests module: please install requests', file=sys.stderr)
21 | sys.exit(1)
22 |
23 |
24 | # Pattern to match Git command-line output for remotes => (user name, project name).
25 | P_GIT_REMOTE = re.compile(r'upstream\s+[^:]+:([^/]+)/([^.]+)\.git\s+\(fetch\)')
26 |
27 | # Repository URL format string.
28 | F_REPO_URL = 'https://github.com/{0}/{1}/'
29 |
30 | # Pattern to match repository URLs => (user name, project name)
31 | P_REPO_URL = re.compile(r'https?://github\.com/([^.]+)/([^/]+)/?')
32 |
33 | # API URL format string.
34 | F_API_URL = 'https://api.github.com/repos/{0}/{1}/labels'
35 |
36 | # Expected labels and colors.
37 | EXPECTED = {
38 | 'help wanted': 'dcecc7',
39 | 'status:in progress': '9bcc65',
40 | 'status:changes requested': '679f38',
41 | 'status:wait': 'fff2df',
42 | 'status:refer to cac': 'ffdfb2',
43 | 'status:need more info': 'ee6c00',
44 | 'status:blocked': 'e55100',
45 | 'status:out of scope': 'eeeeee',
46 | 'status:duplicate': 'bdbdbd',
47 | 'type:typo text': 'f8bad0',
48 | 'type:bug': 'eb3f79',
49 | 'type:formatting': 'ac1357',
50 | 'type:template and tools': '7985cb',
51 | 'type:instructor guide': '00887a',
52 | 'type:discussion': 'b2e5fc',
53 | 'type:enhancement': '7fdeea',
54 | 'type:clarification': '00acc0',
55 | 'type:teaching example': 'ced8dc',
56 | 'good first issue': 'ffeb3a',
57 | 'high priority': 'd22e2e'
58 | }
59 |
60 |
61 | def main():
62 | """
63 | Main driver.
64 | """
65 |
66 | args = parse_args()
67 | reporter = Reporter()
68 | repo_url = get_repo_url(args.repo_url)
69 | check_labels(reporter, repo_url)
70 | reporter.report()
71 |
72 |
73 | def parse_args():
74 | """
75 | Parse command-line arguments.
76 | """
77 |
78 | parser = ArgumentParser(description="""Check repository settings.""")
79 | parser.add_argument('-r', '--repo',
80 | default=None,
81 | dest='repo_url',
82 | help='repository URL')
83 | parser.add_argument('-s', '--source',
84 | default=os.curdir,
85 | dest='source_dir',
86 | help='source directory')
87 |
88 | args, extras = parser.parse_known_args()
89 | require(not extras,
90 | 'Unexpected trailing command-line arguments "{0}"'.format(extras))
91 |
92 | return args
93 |
94 |
95 | def get_repo_url(repo_url):
96 | """
97 | Figure out which repository to query.
98 | """
99 |
100 | # Explicitly specified.
101 | if repo_url is not None:
102 | return repo_url
103 |
104 | # Guess.
105 | cmd = 'git remote -v'
106 | p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE,
107 | close_fds=True, universal_newlines=True)
108 | stdout_data, stderr_data = p.communicate()
109 | stdout_data = stdout_data.split('\n')
110 | matches = [P_GIT_REMOTE.match(line) for line in stdout_data]
111 | matches = [m for m in matches if m is not None]
112 | require(len(matches) == 1,
113 | 'Unexpected output from git remote command: "{0}"'.format(matches))
114 |
115 | username = matches[0].group(1)
116 | require(
117 | username, 'empty username in git remote output {0}'.format(matches[0]))
118 |
119 | project_name = matches[0].group(2)
120 | require(
121 | username, 'empty project name in git remote output {0}'.format(matches[0]))
122 |
123 | url = F_REPO_URL.format(username, project_name)
124 | return url
125 |
126 |
127 | def check_labels(reporter, repo_url):
128 | """
129 | Check labels in repository.
130 | """
131 |
132 | actual = get_labels(repo_url)
133 | extra = set(actual.keys()) - set(EXPECTED.keys())
134 |
135 | reporter.check(not extra,
136 | None,
137 | 'Extra label(s) in repository {0}: {1}',
138 | repo_url, ', '.join(sorted(extra)))
139 |
140 | missing = set(EXPECTED.keys()) - set(actual.keys())
141 | reporter.check(not missing,
142 | None,
143 | 'Missing label(s) in repository {0}: {1}',
144 | repo_url, ', '.join(sorted(missing)))
145 |
146 | overlap = set(EXPECTED.keys()).intersection(set(actual.keys()))
147 | for name in sorted(overlap):
148 | reporter.check(EXPECTED[name].lower() == actual[name].lower(),
149 | None,
150 | 'Color mis-match for label {0} in {1}: expected {2}, found {3}',
151 | name, repo_url, EXPECTED[name], actual[name])
152 |
153 |
154 | def get_labels(repo_url):
155 | """
156 | Get actual labels from repository.
157 | """
158 |
159 | m = P_REPO_URL.match(repo_url)
160 | require(
161 | m, 'repository URL {0} does not match expected pattern'.format(repo_url))
162 |
163 | username = m.group(1)
164 | require(username, 'empty username in repository URL {0}'.format(repo_url))
165 |
166 | project_name = m.group(2)
167 | require(
168 | username, 'empty project name in repository URL {0}'.format(repo_url))
169 |
170 | url = F_API_URL.format(username, project_name)
171 | r = requests.get(url)
172 | require(r.status_code == 200,
173 | 'Request for {0} failed with {1}'.format(url, r.status_code))
174 |
175 | result = {}
176 | for entry in r.json():
177 | result[entry['name']] = entry['color']
178 | return result
179 |
180 |
181 | if __name__ == '__main__':
182 | main()
183 |
--------------------------------------------------------------------------------
/bin/test_lesson_check.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import unittest
4 |
5 | import lesson_check
6 | import util
7 |
8 |
9 | class TestFileList(unittest.TestCase):
10 | def setUp(self):
11 | self.reporter = util.Reporter() # TODO: refactor reporter class.
12 |
13 | def test_file_list_has_expected_entries(self):
14 | # For first pass, simply assume that all required files are present
15 | all_filenames = [filename.replace('%', '')
16 | for filename in lesson_check.REQUIRED_FILES]
17 |
18 | lesson_check.check_fileset('', self.reporter, all_filenames)
19 | self.assertEqual(len(self.reporter.messages), 0)
20 |
21 |
22 | if __name__ == "__main__":
23 | unittest.main()
24 |
--------------------------------------------------------------------------------
/bin/util.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | import json
4 | from subprocess import Popen, PIPE
5 |
6 | # Import this way to produce a more useful error message.
7 | try:
8 | import yaml
9 | except ImportError:
10 | print('Unable to import YAML module: please install PyYAML', file=sys.stderr)
11 | sys.exit(1)
12 |
13 |
14 | # Things an image file's name can end with.
15 | IMAGE_FILE_SUFFIX = {
16 | '.gif',
17 | '.jpg',
18 | '.png',
19 | '.svg'
20 | }
21 |
22 | # Files that shouldn't be present.
23 | UNWANTED_FILES = [
24 | '.nojekyll'
25 | ]
26 |
27 | # Marker to show that an expected value hasn't been provided.
28 | # (Can't use 'None' because that might be a legitimate value.)
29 | REPORTER_NOT_SET = []
30 |
31 |
32 | class Reporter:
33 | """Collect and report errors."""
34 |
35 | def __init__(self):
36 | """Constructor."""
37 | self.messages = []
38 |
39 | def check_field(self, filename, name, values, key, expected=REPORTER_NOT_SET):
40 | """Check that a dictionary has an expected value."""
41 |
42 | if key not in values:
43 | self.add(filename, '{0} does not contain {1}', name, key)
44 | elif expected is REPORTER_NOT_SET:
45 | pass
46 | elif type(expected) in (tuple, set, list):
47 | if values[key] not in expected:
48 | self.add(
49 | filename, '{0} {1} value {2} is not in {3}', name, key, values[key], expected)
50 | elif values[key] != expected:
51 | self.add(filename, '{0} {1} is {2} not {3}',
52 | name, key, values[key], expected)
53 |
54 | def check(self, condition, location, fmt, *args):
55 | """Append error if condition not met."""
56 |
57 | if not condition:
58 | self.add(location, fmt, *args)
59 |
60 | def add(self, location, fmt, *args):
61 | """Append error unilaterally."""
62 |
63 | self.messages.append((location, fmt.format(*args)))
64 |
65 | @staticmethod
66 | def pretty(item):
67 | location, message = item
68 | if isinstance(location, type(None)):
69 | return message
70 | elif isinstance(location, str):
71 | return location + ': ' + message
72 | elif isinstance(location, tuple):
73 | return '{0}:{1}: '.format(*location) + message
74 |
75 | print('Unknown item "{0}"'.format(item), file=sys.stderr)
76 | return NotImplemented
77 |
78 | @staticmethod
79 | def key(item):
80 | location, message = item
81 | if isinstance(location, type(None)):
82 | return ('', -1, message)
83 | elif isinstance(location, str):
84 | return (location, -1, message)
85 | elif isinstance(location, tuple):
86 | return (location[0], location[1], message)
87 |
88 | print('Unknown item "{0}"'.format(item), file=sys.stderr)
89 | return NotImplemented
90 |
91 | def report(self, stream=sys.stdout):
92 | """Report all messages in order."""
93 |
94 | if not self.messages:
95 | return
96 |
97 | for m in sorted(self.messages, key=self.key):
98 | print(self.pretty(m), file=stream)
99 |
100 |
101 | def read_markdown(parser, path):
102 | """
103 | Get YAML and AST for Markdown file, returning
104 | {'metadata':yaml, 'metadata_len':N, 'text':text, 'lines':[(i, line, len)], 'doc':doc}.
105 | """
106 |
107 | # Split and extract YAML (if present).
108 | with open(path, 'r') as reader:
109 | body = reader.read()
110 | metadata_raw, metadata_yaml, body = split_metadata(path, body)
111 |
112 | # Split into lines.
113 | metadata_len = 0 if metadata_raw is None else metadata_raw.count('\n')
114 | lines = [(metadata_len+i+1, line, len(line))
115 | for (i, line) in enumerate(body.split('\n'))]
116 |
117 | # Parse Markdown.
118 | cmd = 'ruby {0}'.format(parser)
119 | p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE,
120 | close_fds=True, universal_newlines=True)
121 | stdout_data, stderr_data = p.communicate(body)
122 | doc = json.loads(stdout_data)
123 |
124 | return {
125 | 'metadata': metadata_yaml,
126 | 'metadata_len': metadata_len,
127 | 'text': body,
128 | 'lines': lines,
129 | 'doc': doc
130 | }
131 |
132 |
133 | def split_metadata(path, text):
134 | """
135 | Get raw (text) metadata, metadata as YAML, and rest of body.
136 | If no metadata, return (None, None, body).
137 | """
138 |
139 | metadata_raw = None
140 | metadata_yaml = None
141 |
142 | pieces = text.split('---', 2)
143 | if len(pieces) == 3:
144 | metadata_raw = pieces[1]
145 | text = pieces[2]
146 | try:
147 | metadata_yaml = yaml.load(metadata_raw)
148 | except yaml.YAMLError as e:
149 | print('Unable to parse YAML header in {0}:\n{1}'.format(
150 | path, e), file=sys.stderr)
151 | sys.exit(1)
152 |
153 | return metadata_raw, metadata_yaml, text
154 |
155 |
156 | def load_yaml(filename):
157 | """
158 | Wrapper around YAML loading so that 'import yaml' is only needed
159 | in one file.
160 | """
161 |
162 | try:
163 | with open(filename, 'r') as reader:
164 | return yaml.load(reader)
165 | except (yaml.YAMLError, IOError) as e:
166 | print('Unable to load YAML file {0}:\n{1}'.format(
167 | filename, e), file=sys.stderr)
168 | sys.exit(1)
169 |
170 |
171 | def check_unwanted_files(dir_path, reporter):
172 | """
173 | Check that unwanted files are not present.
174 | """
175 |
176 | for filename in UNWANTED_FILES:
177 | path = os.path.join(dir_path, filename)
178 | reporter.check(not os.path.exists(path),
179 | path,
180 | "Unwanted file found")
181 |
182 |
183 | def require(condition, message):
184 | """Fail if condition not met."""
185 |
186 | if not condition:
187 | print(message, file=sys.stderr)
188 | sys.exit(1)
189 |
--------------------------------------------------------------------------------
/checklist.md:
--------------------------------------------------------------------------------
1 | # Checklist Questions to stimulate thought about a Project's Reproducibility
2 |
3 | The following checklist serves as a tool to help you think about the reproducibility of your data analysis. Many of the questions can be thought of as having a yes/no answer. A better approach would be to see the questions as being open ended with the real question being, "What can I do to improve the status of my project on this bullet point?". With that in mind, you'll never get 100% of the bullets right for your project, but you'll always be improving.
4 |
5 | ## Documentation
6 | * Is there a README file that indicates the purpose of the project, who to contact with questions, a map of the directory structure, and a description of what software and hardware is needed to reproduce your workflow?
7 | * Are there README files in each folder describing the contents of the folder, how they were acquired/generated?
8 | * Is there a CITATION file that tells users how to site the project, data, and code?
9 | * Are there instructions on how to obtain the raw data and citations for those data?
10 | * Is there a list of dependencies with the exact version number of every external application used in the process?
11 | * Do you indicate dates that websites were accessed to obtain data?
12 | * Are there appropriate LICENSE files that specifies the license under which you're distributing your content, data, and code? Have you edited them to include informations pertinent to your project?
13 | * Have you noted the license(s) for others peoples' content, data, and code used in your analysis?
14 | * For analyses that utilize a random number generator, have you noted the underlying random seed(s)? Do you state the other seeds that you have tested the results with?
15 | * Is your code well documented?
16 | * Do you use a self-commenting coding practice?
17 | * Do each of your scripts have a header indicating the inputs, outputs, and dependencies?
18 | * Is it documented how files relate to each other?
19 |
20 |
21 | ## Organization
22 | * Are all data, code, results, and documentation housed within a monophyletic folder structure?
23 | * Is this folder structure under version control?
24 | * Is the project's repository publicly avaialable?
25 | * Are there assurances that this repository will remain accessible?
26 | * Is your project folder structured to separate your data, code, documentation, and results?
27 | * Does your code run from the project's home directory and output to the appropriate directory?
28 | * Are your raw and processed data files separated?
29 | * Is your raw data truly raw or has it been manipulated?
30 | * Are files that store manually-entered data structured to be easily read by a computer?
31 | * Do files use a consistent naming scheme that indicates what they contain?
32 | * Is there a mechanism in place to archive large files?
33 | * When using other people's data, are you defensive against tarbombs?
34 |
35 |
36 | ## Automation
37 | * Is the project under the control of a makefile? Could one run `make clean; make`?
38 | * How long would it take to rebuild your directory system if your hard drive failed?
39 | * Is manual manipulation of data kept to a minimum?
40 | * If manual manipulation is required, is there sufficient documentation to re-do the manipulation?
41 | * Does data processing make use of open software code?
42 | * How sensitive are results to differences in operating system, dependency versions?
43 | * Is code written to be flexible enough to the addition of new data?
44 | * Does code include unit tests to confirm that it does what you think it does?
45 | * Does your repository make use of continuous integration tools to insure internal reproduciblity?
46 |
47 |
48 | ## Publication
49 | * Are papers and reports from the project generated using literate programming tools so that results are not hard-coded?
50 | * Did you include a reproducibility statement or declaration at the end of your paper(s)?
51 | * Did you archive preprints of resulting papers in a public repository?
52 | * Did you release the underlying code and new data at the time of submitting a paper?
53 | * What mechanisms are in place to insure your project remain accessible and reproducible in 5 years?
54 |
--------------------------------------------------------------------------------
/code/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/code/.gitkeep
--------------------------------------------------------------------------------
/data/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/data/.gitkeep
--------------------------------------------------------------------------------
/data/README.md:
--------------------------------------------------------------------------------
1 | # Data files for intro workshop
2 |
3 | - `gapminder.csv`: Entire GapMinder dataset
4 | - `gapminder-5060.csv`: 1950s and 1960s
5 | - `gapminder-7080.csv`: 1970s and 1980s
6 | - `gapminder-90plus.csv`: 1990s onwards
7 |
8 | - **Important note about `gapminder-5060.csv`:
9 | - The dataset has been altered to add a "data error".
10 | - Life expectancy for Canada in the year 1967 is coded
11 | as `999999`, it should actually be `69.96`.
12 | - For details see [intro-01-slides.Rmd](https://github.com/Reproducible-Science-Curriculum/rr-intro/blob/master/intro-01-slides.Rmd).
13 | - `gapminder-5060_original.csv` contains the correct data.
--------------------------------------------------------------------------------
/data/gapminder.rdata:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/data/gapminder.rdata
--------------------------------------------------------------------------------
/fig/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/fig/.gitkeep
--------------------------------------------------------------------------------
/fig/rmd-plot-example-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/fig/rmd-plot-example-1.png
--------------------------------------------------------------------------------
/figure/more_task_3-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/figure/more_task_3-1.png
--------------------------------------------------------------------------------
/figure/task_2_visualize-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/figure/task_2_visualize-1.png
--------------------------------------------------------------------------------
/figure/task_3-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/figure/task_3-1.png
--------------------------------------------------------------------------------
/figure/unnamed-chunk-1-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/figure/unnamed-chunk-1-1.png
--------------------------------------------------------------------------------
/files/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/files/.gitkeep
--------------------------------------------------------------------------------
/img/RSplashScreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/img/RSplashScreen.png
--------------------------------------------------------------------------------
/img/RStudio-Logo-Blue-Gradient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/img/RStudio-Logo-Blue-Gradient.png
--------------------------------------------------------------------------------
/img/RStudioSplash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/img/RStudioSplash.png
--------------------------------------------------------------------------------
/img/Rlogo-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/img/Rlogo-1.png
--------------------------------------------------------------------------------
/img/coffee_000000_264.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/img/coffee_000000_264.png
--------------------------------------------------------------------------------
/img/wrench_000000_264.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datacarpentry/rr-intro/b8de017e72f51f054f4f768e0919c4117dd0a1bf/img/wrench_000000_264.png
--------------------------------------------------------------------------------
/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: lesson
3 | root: .
4 | ---
5 | This is the Introduction to Reproducible Research with `R`.
6 |
7 | > ## Prerequisites
8 | > You should install the following software:
9 | > - `R`
10 | > - `RStudio`
11 | >
12 | > See the setup instructions for details on specific packages to install.
13 | {: .prereq}
14 |
--------------------------------------------------------------------------------
/intro-01-instr-notes.md:
--------------------------------------------------------------------------------
1 |
2 | ## As participants arrive...
3 |
4 | Participants have been asked to install or update R and RStudio prior to the workshop,
5 | as well as install the following packages:
6 |
7 | - `knitr`
8 | - `rmarkdown`
9 | - `ggplot2`
10 | - `dplyr`
11 |
12 | It is possible that some of them did not yet do that. If people show up early remind
13 | them to complete installation, and re-point them to the instructions in the
14 | pre-workshop email and/or the workshop website. Note that they will not need these tools until after the coffee break.
15 |
16 |
17 | ## Intro (15 min)
18 |
19 | ## Welcome + overview
20 |
21 | - Welcome the participants and briefly go over the schedule for the 2-day workshop.
22 | - Schedule is purposefully not included on the slides since each workshop might
23 | follow a slightly different schedule.
24 | - Remind them the mission statement and the tagline:
25 | - Mission statement: To Train researchers in the best practices and approaches of reproducible research and accelerate scientific progress
26 | - Tagline: Accelerating scientific progress through reproducible science.
27 | - Getting to know you exercise and group discussion:
28 | - 6 months from now can you or someone else go back to your project and understand what was going on? What types of methods do you use to document a project?
29 | - Take notes on the board as to tools people use.
30 | - Review a few case studies:
31 | - Some are already discussed in `intro-01-slides`
32 | - If you prefer to discuss others, see some examples at https://github.com/Reproducible-Science-Curriculum/Reproducible-Science-Hackathon-Dec-08-2014/wiki/Irreproducible-Examples
33 |
34 | ## Exercise: Motivating reproducibility (40 mins)
35 |
36 | ### Part 1: Analyze + document (20 minutes)
37 |
38 | #### From the slides:
39 |
40 |
41 | Complete the following tasks and **write instructions /
42 | documentation** for your collaborator to reproduce your work starting with the
43 | original dataset (`data/gapminder-5060.csv`).
44 |
45 | 1. Visualize life expectancy over time for Canada in the 1950s and 1960s using
46 | a line plot.
47 | 2. Something is clearly wrong with this plot! Turns out there's a data error
48 | in the data file: life expectancy for Canada in the year 1967 is coded
49 | as `999999`, it should actually be `69.96`. Make this correction.
50 | 3. Visualize life expectancy over time for Canada again, with the corrected
51 | data.
52 | *Stretch goal:* Add lines for Mexico and US.
53 |
54 |
55 | #### Tips for instructors:
56 |
57 | - Some people will assume they have to do this in R, even if they're not an R user,
58 | remind them that the whole point of the exercise is that they do this in an
59 | environment they use / are comfortable with. (Assure them that we'll get to R
60 | later...)
61 | - Remind them that they need to document -- in past workshops most people got hung
62 | up on doing, then documenting, and then the second part of the exercises didn't
63 | have as much of a punch. More important that they document what they do (even if
64 | not all tasks) than that they finish.
65 |
66 | ### Part 1: Swap + discuss (15 minutes)
67 |
68 | #### From the slides:
69 |
70 |
71 | Introduce yourself to your collaborator and tell them why you're here.
72 |
73 | 1. Swap instructions / documentation with your collaborator, and try to reproduce
74 | their work, first **without talking to each oher**.
75 | If your collaborator does not have the software they need to reproduce your work, we
76 | encourage you to either help them install it or walk them through it on your computer
77 | in a way that would emulate the experience. (Remember, this could be part of the
78 | irreproducibility problem!)
79 | 2. Then, talk to each other about challenges you faced (or didn't face) or why
80 | you were or weren't able to reproduce their work.
81 |
82 |
83 | #### Tips for instructors:
84 |
85 | - People not having the software their partner used is likely to be the biggest issue
86 | in this exercise. There isn't really enough time to install sofware, or software might
87 | be proprietary. In these cases ask people to keep it to a discussion.
88 | - Encourage people to read code, even if they don't know the language. If well
89 | documented/commented, one might still be able to follow the code even if they couldn't
90 | write it themselves from scratch.
91 |
92 | ### Reflection - group discussion: (5 mins)
93 |
94 | #### From the slides:
95 |
96 |
97 | - What tools did you use (Excel / R / Python / Word / plain text etc.)?
98 | - Were you successful in reproducing each others' work?
99 |
100 |
101 |
102 | - What would happen if your collaborator is no longer available to walk you through
103 | their analysis?
104 | - What made it easy / hard for reproducing your partners' work?
105 | - What would have to happen if
106 | - you had to swap out the dataset or extend the analysis further?
107 | - you caught further data errors and had to re-create the analysis
108 | with corrections?
109 | - you had to revert back to the original dataset?
110 |
111 |
112 | #### Tips for instructors:
113 |
114 | - Collect data from the students on their tool choice and success. Tallying these
115 | on the board creates a nice visual.
116 | - If you know that the session will have a large number of participants preparing a
117 | Google Form might be useful.
118 | - Keep the discussion on the second set of questions to an informal discussion, and
119 | feel free to keep it short if exercise took longer than intended.
120 |
--------------------------------------------------------------------------------
/intro-02-instr-notes.md:
--------------------------------------------------------------------------------
1 |
2 | ## Introduce toolkit
3 |
4 | - R, RStudio, R Markdown
5 |
6 | - Walk through splash screens of R and RStudio (but spend more time on RStudio)
7 |
8 | ## R Markdown demo
9 |
10 | The goal of is to demonstrate how each of the goals of Organization, Documentation, Dissemination, and Automation can be addressed in an R Markdown document.
11 |
12 | ### Key steps introduced:
13 |
14 | **IMPORTANT:** Emphasize that this exercise is NOT about understanding all the R commands,
15 | but rather getting the big picture of how using R in this way facilitates reproducible
16 | analyses.
17 |
18 | - Demonstrate "good practice" for organizing data files and analysis
19 | documents (R Markdown)
20 | - How to read data from a file
21 | - How to manipulate the data, and document it in a reproducible way
22 | - How easy it would be to revert any changes if need be
23 | - How to subset data
24 | - How to make simple plots in ggplot
25 |
26 | ### Important features of an R Markdown document to discuss:
27 |
28 | - YAML on top
29 | - Code in chunks
30 | - R Markdown syntax
31 | - Human readable!
32 | - Limited, so not too time consuming to master
33 | - Self contained workspace
34 |
35 | ### Extend the analysis:
36 |
37 | All code included in the template.
38 |
39 | Important to emphasize we're using the same subsetting and visualization code,
40 | just with new data. Reproducing old work with new data is easy!
41 |
42 | ### Take aways:
43 |
44 | - The analysis is self-documenting
45 | - It's easy to extend or refine analyses by copying and modifying code blocks
46 | - The results of the analysis can be disseminated by sending R Markdown and
47 | providing data sources, or just simply providing the generated HTML of just
48 | a summary of the analysis is needed
49 |
50 | ## Reproducibility checklist:
51 |
52 | Point them to the checklist (`checklist.md`), don't read the whole list (too long), but can
53 | discuss the documentation part if there is time.
54 |
--------------------------------------------------------------------------------
/intro/intro-template.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: 'Intro Session: Motivating reproducibility'
3 | output:
4 | html_document:
5 | fig_height: 3
6 | fig_width: 6
7 | pdf_document: default
8 | ---
9 |
10 | This RMarkdown file contains R code you can use to complete the exercises from the Intro
11 | session. To see the output simply click on *Knit HTML* above. This might prompt you to
12 | install and load some required packages, specifically `knitr`. Just click yes, and the a
13 | document including this narrative, the R code, and figures should pop up.
14 |
15 | ## Data:
16 |
17 | The `read.csv` function is used to read the data into R. Note that the argument provided
18 | for this function is the complete path that leads to the dataset from your current
19 | working directory (where this RMarkdown file is located). Also note that this is provided
20 | as a character string, hence in quotation marks.
21 |
22 | ```{r}
23 | gap_5060 <- read.csv("../data/gapminder-5060.csv")
24 | ```
25 |
26 | ## Packages:
27 |
28 | We will use the `ggplot2` and `dplyr` packages to make the plots for these exercises.
29 |
30 | - `ggplot2` for plotting: This is not the only way to make this plot, but this package
31 | has some aesthetic defaults that makes it attractive. Find out more about the package
32 | at http://ggplot2.org/.
33 | - `dplyr` for data wrangling: This is not the only way manipulate data in R, but this
34 | package uses piping and a simple set of verbs for most common data wranling tasks which
35 | makes it attractive. See the package vignette at https://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html.
36 |
37 | At this point you should have installed these packages using `install.packages()`.
38 |
39 | Now we need to explicitly load the packages:
40 |
41 | ```{r message=FALSE}
42 | library("ggplot2")
43 | library("dplyr")
44 | ```
45 |
46 | #### Task 1: Visualize life expectancy over time for Canada in the 1950s and 1960s using a line plot.
47 |
48 | 1. Filter the data for Canada only:
49 | ```{r}
50 | gap_5060_CA <- gap_5060 %>%
51 | filter(country == "Canada")
52 | ```
53 |
54 | 2. Visaualize:
55 | ```{r}
56 | ggplot(data = gap_5060_CA, aes(x = year, y = lifeExp)) +
57 | geom_line()
58 | ```
59 |
60 | #### Task 2: Something is clearly wrong with this plot! Turns out there's a data error in the data file: life expectancy for Canada in the year 1957 is coded as `999999`, it should actually be `69.96`. Make this correction.
61 |
62 | - `mutate` for creating a new variables
63 | - `replace` for replacing a data entry in a specific
64 | location as determined by the logical statement `(country == "Canada" & year == 1957)`
65 | ```{r}
66 | gap_5060 <- gap_5060 %>%
67 | mutate(lifeExp = replace(lifeExp, (country == "Canada" & year == 1957), 69.96)) %>%
68 | as.data.frame()
69 | ```
70 |
71 | #### Task 3: Visualize life expectancy over time for Canada again, with the corrected data.
72 |
73 | Exact same code as before, but note that the contents of `gap_5060` are different as it
74 | has been updated in the previous task.
75 | ```{r}
76 | gap_5060_CA <- gap_5060 %>%
77 | filter(country == "Canada")
78 |
79 | ggplot(data = gap_5060_CA, aes(x = year, y = lifeExp)) +
80 | geom_line()
81 | ```
82 |
83 | #### Task 3 - Stretch goal: Add lines for Mexico and United States.
84 |
85 | - `%in%` for logical operator testing if a country's name is in the list provided
86 | - Same visualization code as before, only difference is the input dataset
87 | ```{r}
88 | gap_5060_NA <- gap_5060 %>%
89 | filter(country %in% c("Canada", "Mexico", "United States"))
90 |
91 | ggplot(data = gap_5060_NA, aes(x = year, y = lifeExp, color = country)) +
92 | geom_line()
93 | ```
94 |
95 | #### Extending your analysis with new data:
96 |
97 | Load the new data:
98 | ```{r}
99 | gap_7080 <- read.csv("data/gapminder-7080.csv")
100 | gap_90plus <- read.csv("data/gapminder-90plus.csv")
101 | ```
102 |
103 | Cobine data frames with `rbind` (**r**ow bind):
104 | ```{r}
105 | gap <- rbind(gap_5060, gap_7080, gap_90plus)
106 | ```
107 |
108 | Make the same plots, with the same code, just changing the input data frame:
109 |
110 | 1. Canada only:
111 | ```{r}
112 | gap_ca <- gap %>%
113 | filter(country == "Canada")
114 |
115 | ggplot(data = gap_ca, aes(x = year, y = lifeExp)) +
116 | geom_line()
117 | ```
118 |
119 | 2. North America:
120 | ```{r}
121 | gap_NA <- gap %>%
122 | filter(country %in% c("Canada", "Mexico", "United States"))
123 |
124 | ggplot(data = gap_NA, aes(x = year, y = lifeExp, color = country)) +
125 | geom_line()
126 | ```
--------------------------------------------------------------------------------
/pre-workshop-survey.md:
--------------------------------------------------------------------------------
1 | Pre-workshop survey
2 | ========
3 |
4 | What is your current position?
5 |
6 | * Graduate student
7 | * Postdoctoral felow
8 | * Faculty
9 | * Staff
10 | * Other: _____________
11 |
12 | Which of the following discipline(s) do you work in?
13 | check all that apply
14 |
15 | * Brain and neuroscience
16 | * Chemistry
17 | * Computer science
18 | * Earth sciences
19 | * Economics
20 | * Engineering
21 | * Humanities
22 | * Life sciences
23 | * Math
24 | * Medicine
25 | * Physics
26 | * Social sciences
27 | * Statistics
28 | * Other: _____________
29 |
30 | Which operating system will you use for the workshop?
31 |
32 | * Windows
33 | * OS X
34 | * Linux
35 | * I do not know
36 | * Other: ______________
37 |
38 | Which of the methods below do you use to record progress on your work?
39 | check all that apply
40 |
41 | * Handwritten notes (e.g. a lab notebook)
42 | * Documents on your computer (e.g. Word, text files)
43 | * Online notes (e.g. Google Docs, wikis)
44 | * Comments in scripts
45 | * Literate programming (e.g. R markdown, iPython notebook)
46 | * Other: ______________
47 |
48 | How often do you currently program?
49 |
50 | * I never program
51 | * Once per year or less
52 | * Several times per year
53 | * A few times per month
54 | * A few times per week
55 | * Every day
56 |
57 | What programming languages do you use regularly? *
58 | Check all that apply
59 | * Python
60 | * R
61 | * C / C++
62 | * Java
63 | * Perl
64 | * Other: ______________
65 |
66 | How frequently do you make your code, data, and analyses publicly available?
67 | * Never
68 | * Rarely
69 | * Sometimes
70 | * Most of the time
71 | * Always
72 |
73 | If you were to give a colleague all of the data and documentation for a project, how confident are you that they could produce your results and figures?
74 |
75 | * Very confident
76 | * Confident
77 | * Somewhat confident
78 | * Not very confident
79 | * Not confident
80 |
81 | When you do share code / data, what motivates you to do so? *
82 | Check all that apply
83 | * Journal requirement
84 | * Funding agency requirement
85 | * Opinion of PI / supervisor
86 | * Opinion of colleagues
87 | * Other: ______________
88 |
89 | Why did you sign up for this workshop?
90 |
91 | (open ended)
--------------------------------------------------------------------------------
/preworkshop-email.md:
--------------------------------------------------------------------------------
1 | Pre-workshop email
2 | =========
3 |
4 | This document contains standard language that can be used in the pre-workshop email
5 | including instructions for software set-up.
6 |
7 | **Note:** The document is designed for a workshop using R, if using another language,
8 | update accordingly.
9 |
10 | * * *
11 |
12 | Prior to the workshop, please download and install R, [a free software environment for
13 | statistical computing and graphics](http://www.r-project.org/) and RStudio, [a powerful
14 | user interface for R](http://www.rstudio.com/). Note that R is the name of the
15 | programming language itself and RStudio is a convenient interface. Therefore while you
16 | will be working in RStudio throughout the workshop, R must also be installed on your
17 | computer.
18 |
19 | **Download:**
20 |
21 | * *R*: You can download R from [CRAN](http://cran.r-project.org/), the Comprehensive R
22 | Archive Network. It is highly recommended to install a precompiled binary distribution
23 | for your operating system – use the links up at the top of the CRAN page.
24 | * *RStudio*: You can download RStudio Desktop [here](http://www.rstudio.com/products/rstudio/download/).
25 |
26 | **Install:** Instructions for installing R and RStudio are provided below, as well as
27 | links to videos that walk you through the process. Note newer versions of R and RStudio
28 | may have been released since this video, and hence the version names you come accross may
29 | not match what you see on the video. However the general instructions should still work.
30 |
31 | Do not worry if you run into any trouble during the installation, we will have some time
32 | during the workshop to help you.
33 |
34 | - Mac / OS X:
35 | - [Video instructios](https://www.youtube.com/watch?v=Ywj6yNfc5nM) - includes RStudio
36 | installation
37 | - Instal R: Install R-3.2.2.pkg. This runs on OS X 10.9 and later (Mavericks
38 | and Yosemite). To install, just double-click on the icon of the file you downloaded.
39 | See [here](http://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installing-R-under-OS-X for) for more info.
40 | - Install RStudio: Double click on RStudio-0.99.484.dmg and follow the prompts.
41 |
42 | - PC / Windows:
43 | - [Video instructios](https://www.youtube.com/watch?v=eD07NznguA4)
44 | - Install R: Installation is via the installer R-3.2.2-win.exe. Just double-click on
45 | the icon and follow the instructions. See [here](http://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installing-R-under-Windows) for more info.
46 | - Install RStudio:Double click on RStudio-0.99.484.exe and follow the prompts.
47 |
48 | - Unix-alikes: See [here](http://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installing-R-under-Unix_002dalikes) for more info.
49 |
50 | **Testing:** Do whatever is appropriate for your OS to launch RStudio. You should get a
51 | window similar to the screenshot you see in the video [here](http://www.rstudio.com/products/rstudio/). Put your cursor in the pane labelled
52 | *Console*, which is where you interact with the live R process. Create a simple object
53 | with code like `x <- 2 * 4` (followed by enter or return). Then inspect the `x` object by
54 | typing `x` followed by enter or return. Obviously you should see the value 8 print to
55 | screen. If yes, you are good to go.
56 |
57 | **Add-on packages:** R is an extensible system and many people share useful code they
58 | have developed as a package via CRAN and github. To install a package from CRAN, for
59 | example the `ggplot2` package for data visualization (which we will use during the
60 | workshop) type `install.packages("ggplot2")` in your Console. This is one way of
61 | installing packages (there are others).
--------------------------------------------------------------------------------
/reference.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: reference
3 | permalink: /reference/
4 | ---
5 |
6 | ## Glossary
7 | - Peng (2009) Reproducible research and Biostatistics. [*Biostatistics 10: 405-408*](http://biostatistics.oxfordjournals.org/content/10/3/405.full)
8 | - **Replication** - when independent investigators use methods, protocols, data, and equipment to confirm scientific claims.
9 | - **Reproduction** - when data sets and computer code are made available for researchers to verify results.
10 |
--------------------------------------------------------------------------------
/setup.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Setup
4 | permalink: /setup/
5 | ---
6 | You will need to install the following programs and packages:
7 |
8 | - `R`
9 | - `RStudio`
10 |
11 | ~~~
12 | install.packages("tidyverse")
13 | install.packages("rmarkdown")
14 | install.packages("knitr")
15 | ~~~
16 | {: .language-r}
17 |
--------------------------------------------------------------------------------
/slides/intro-01-slides.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Intro I: Motivating reproducibility"
3 | author: "Reproducible Science Workshop"
4 | output:
5 | ioslides_presentation:
6 | highlight: pygments
7 | widescreen: yes
8 | ---
9 |
10 | # Overview
11 |
12 | ## Tagline and mission
13 |
14 | Tagline: Accelerating scientific progress through reproducible science
15 |
16 | Mission: To train researchers in the best practices and approaches of
17 | reproducible research and accelerate scientific progress.
18 |
19 |
20 | ## Intro to Reproducible Research outline
21 |
22 | - Getting to know you
23 | - Recognize the problems that reproducible research helps address
24 | via a case studies
25 | - **Exercise**: Identify pain points in getting your analysis to be reproducible
26 | - Introduce tools that address these pain points
27 | - **Demo**: Computational toolkit for reproducibile data analysis
28 |
29 |
30 | ## Getting to know you...
31 |
32 | with respect to reproducibility
33 |
34 |
35 |
36 | # Why should we care about reproducibility?
37 |
38 | ## Science retracts gay marriage paper without agreement of lead author
39 |
40 | - Science retracted a study of how canvassers can sway people's opinions about
41 | gay marriage.
42 |
43 | - Science Editor-in-Chief: Original survey data not made available for independent
44 | reproduction of results + Survey incentives misrepresented + Sponsorship
45 | statement false
46 |
47 | - Two Berkeley grad students attempted to replicate the study and discovered that
48 | the data must have been faked.
49 |
50 | - Methods we'll discuss today can't prevent this, but they can make it easier to
51 | discover such issues.
52 |
53 |
54 | Source:
55 | http://news.sciencemag.org/policy/2015/05/science-retracts-gay-marriage-paper-without-lead-author-s-consent
56 |
57 |
58 |
59 | ## Seizure study retracted after authors realize data got "terribly mixed"
60 |
61 | From the authors of **Low Dose Lidocaine for Refractory Seizures in Preterm Neonates**:
62 |
63 | *"The article has been retracted at the request of the authors. After carefully
64 | re-examining the data presented in the article, they identified that data of two
65 | different hospitals got terribly mixed. The published results cannot be reproduced in
66 | accordance with scientific and clinical correctness."*
67 |
68 |
69 | Source: http://retractionwatch.com/2013/02/01/seizure-study-retracted-after-authors-realize-data-got-terribly-mixed/
70 |
71 |
72 |
73 | ## Bad spreadsheet merge kills depression paper, quick fix resurrects it
74 |
75 | - The authors informed the journal that the merge of lab results and other survey
76 | data used in the paper resulted in an error regarding the identification codes.
77 |
78 | - **Original conclusion:** Lower levels of CSF IL-6 were associated with current
79 | depression and with future depression [...].
80 |
81 | - **Revised conclusion:** Higher levels of CSF IL-6 and IL-8 were associated with
82 | current depression [...].
83 |
84 |
85 | Source:
86 | http://retractionwatch.com/2014/07/01/bad-spreadsheet-merge-kills-depression-paper-quick-fix-resurrects-it/
87 |
88 |
89 |
90 | # Exercise: Motivating reproducibility
91 |
92 | ## Exercise: Motivating reproducibility
93 |
94 | This is a two-part exercise:
95 |
96 | **Part 1:** Analyze + document
97 |
98 | **Part 2:** Swap + discuss
99 |
100 |
101 | ## Part 1: Analyze + document
102 |
103 | Complete the following tasks and **write instructions / documentation** for your
104 | collaborator to reproduce your work starting with the original dataset
105 | (`data/gapminder-5060.csv`).
106 |
107 | 1. Visualize life expectancy over time for Canada in the 1950s and 1960s using
108 | a line plot.
109 |
110 | 2. Something is clearly wrong with this plot! Turns out there's a data error
111 | in the data file: life expectancy for Canada in the year 1957 is coded
112 | as `999999`, it should actually be `69.96`. Make this correction.
113 |
114 | 3. Visualize life expectancy over time for Canada again, with the corrected data.
115 | *Stretch goal:* Add lines for Mexico and United States.
116 |
117 |
118 | ## Part 2: Swap + discuss
119 |
120 | Introduce yourself to your collaborator and tell them why you're here.
121 |
122 | 1. Swap instructions / documentation with your collaborator, and try to reproduce
123 | their work, first **without talking to each oher**.
124 | If your collaborator does not have the software they need to reproduce your work, we
125 | encourage you to either help them install it or walk them through it on your computer
126 | in a way that would emulate the experience. (Remember, this could be part of the
127 | irreproducibility problem!)
128 |
129 | 2. Then, talk to each other about challenges you faced (or didn't face) or why
130 | you were or weren't able to reproduce their work.
131 |
132 |
133 | ## Reflection
134 |
135 | - What tools did you use (Excel / R / Python / Word / plain text etc.)?
136 | - Were you successful in reproducing each others' work?
137 |
138 |
139 |
140 | - What would happen if your collaborator is no longer available to walk you through
141 | their analysis?
142 | - What made it easy / hard for reproducing your partners' work?
143 | - What would have to happen if
144 | - you had to swap out the dataset or extend the analysis further?
145 | - you caught further data errors and had to re-create the analysis
146 | with corrections?
147 | - you had to revert back to the original dataset?
148 |
149 |
150 | ## Summary
151 |
152 | - Everyone struggles with reproducibility and it is a hindrance to moving
153 | science forward
154 |
155 | - Evan with a fairly simple analysis challenges were faced in four main areas:
156 | organization, documentation, automation, and dissemination
157 |
158 | - Over the two day workshop, data analysis tasks will become more complex as we
159 | gather more data and ask more complicated questions, so we need better tools and
160 | workflows to combat issues arising in these areas
161 |
162 | # Four facets of reproducibility
163 |
164 | ## Four facets of reproducibility
165 |
166 | 1. **Documentation:** difference between binary files (e.g. docx) and text files and
167 | why text files are preferred for documentation
168 | - *Protip:* Use markdown to document your workflow so that anyone can pick up your
169 | data and follow what you are doing
170 | - *Protip:* Use literate programming so that your analysis and your results are
171 | tightly connected, or better yet, unseperable
172 |
173 | 2. **Organization:** tools to organize your projects so that you don't have a single
174 | folder with hundreds of files
175 |
176 | 3. **Automation:** the power of scripting to create automated data analyses
177 |
178 | 4. **Dissemination:** publishing is not the end of your analysis, rather it is a way
179 | station towards your future research and the future research of others
--------------------------------------------------------------------------------
/slides/intro-02-slides.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Intro II: Reproducibility toolkit"
3 | author: "Reproducible Science Workshop"
4 | output:
5 | ioslides_presentation:
6 | highlight: pygments
7 | widescreen: yes
8 | ---
9 |
10 | # Reproduciblility toolkit
11 |
12 | ## R + RStudio
13 |
14 |
24 | - Programming language for data analysis
25 | - Free!
26 | - Open source
27 | - Widely used and supported across all disciplines
28 | - Can be used on Windows, Mac OS X, or Linux
29 |
30 | 
31 |
32 |
33 |
34 | ## Why not language X?
35 |
36 | - There are a number of other great programming tools out there that can also be
37 | used to improve the reproducibility of your analysis
38 |
39 | - The key is to use some type of language that will allow you to automate and
40 | document your analysis
41 |
42 | - Once you master one language you'll probably find it easier to learn another
43 |
44 |
45 | ## Once in R
46 |
47 | You could just type into the command prompt...
48 |
49 | - ... but that doesn't help much with documentation
50 |
51 | - ... but that doesn't help much with automation
52 |
53 |
54 | ## A better solution
55 |
56 | With RStudio you can combine your programming and your documentation
57 |
58 |
59 | - RStudio gives you a single environment to combine your documentation and your
60 | analysis
61 | - It runs on top of R
62 | - Gives you a bunch of really cool features that we'll explore throughout the
63 | workshop
64 |
65 | 
66 |
67 |
68 | ## Anatomy of RStudio
69 |
70 |
71 | - Left: Console
72 | - Text on top at launch: version of R that you’re running
73 | - Below that is the prompt
74 | - Upper right: Workspace and command history
75 | - Lower right: Plots, access to files, help, packages, data viewer
76 |
77 | 
78 |
79 |
80 | ## R Packages
81 |
82 | - Packages are the fundamental units of reproducible R code. They include reusable R
83 | functions, the documentation that describes how to use them, and (often) sample data.
84 | (From: http://r-pkgs.had.co.nz)
85 |
86 | - We will use the `ggplot2` package for plots and `dplyr` for data wrangling in this
87 | session.
88 |
89 | - If you have not yet done so, install these packages by running the following
90 | in the Console:
91 | ```{r eval=FALSE}
92 | install.packages("ggplot2")
93 | install.packages("dplyr")
94 | ```
95 |
96 | - This is just one way of installing a package, there is also a GUI approach in
97 | the Packages pane
98 |
99 | # Demo
100 |
101 | ## Goals of the demo
102 |
103 | - Demonstrate "good practice" for organizing data files and analysis
104 | documents (R Markdown)
105 | - How to read data from a file
106 | - How to manipulate the data, and document it in a reproducible way
107 | - How easy it would be to revert any changes if need be
108 | - How to subset data
109 | - How to make simple plots in ggplot
110 |
111 | **NOT** about understanding all the R commands, but **rather** getting the big
112 | picture of how using R in this way facilitates reproducible analyses
113 |
114 | ## R Markdown demo
115 |
116 | - Open `intro-template.Rmd`
117 |
118 | - Click on *Knit HTML* to compile the document
119 |
120 | - Important features:
121 | - YAML on top
122 | - Code in chunks
123 | - R Markdown syntax
124 | - Human readable!
125 | - Limited, so not too time consuming to master
126 | - Self contained workspace
127 |
128 | ## Extending the analysis
129 |
130 | Great news!? We just received some more data, in bits and pieces of course:
131 |
132 | - `gapminder-7080.csv`
133 | - `gapminder-90plus.csv`
134 |
135 | Let's walk through generation of new plots for the 1970s and 1980s and 1990s plus (these new analyses are already in the `intro-tutorial.Rmd` document).
136 |
137 | Note that all code required to accomplish these tasks is also in the template.
138 | You do not need to come up with the R code, **knit** the document to combine
139 | the datasets and you'll see that the code required for recreating the plots
140 | is the same as above. That's the beauty of R Markdown!
141 |
142 |
143 | ## Take aways
144 |
145 | - The analysis is self-documenting
146 | - It's easy to extend or refine analyses by copying and modifying code blocks
147 | - The results of the analysis can be disseminated by sending R Markdown and
148 | providing data sources, or just simply providing the generated HTML of just
149 | a summary of the analysis is needed
150 |
151 | # Reproducibility checklist
152 |
153 | ## Reproducibility checklist
154 |
155 | - Serves as a tool to help you think about the reproducibility of your data
156 | analysis.
157 | - Many of the questions can be thought of as having a yes/no answer.
158 | - A better approach would be to see the questions as being open ended with
159 | the real question being, "What can I do to improve the status of my project
160 | on this bullet point?"
161 | - With that in mind, you'll never get 100% of the bullets right for your project,
162 | but you'll always be improving.
163 |
164 |
--------------------------------------------------------------------------------
/styling.css:
--------------------------------------------------------------------------------
1 | .boxed {
2 | margin-top: 30px;
3 | margin-bottom: 30px;
4 | color: #808080;
5 | padding: 10px 10px;
6 | font-size: 10pt;
7 | background-color: rgba(128, 128, 128, 0.2);
8 | }
--------------------------------------------------------------------------------