Skip to content

Commit 1e7f40c

Browse files
Merge pull request #292 from coding-for-reproducible-research/286_remove_r_magic
Change kernel, remove magic, add new R style quiz html
2 parents d98d6c6 + 51121d9 commit 1e7f40c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+7027
-35542
lines changed

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ execute:
5757
- 'individual_modules/introduction_to_r/plots.ipynb'
5858
- 'individual_modules/introduction_to_r/stats.ipynb'
5959
- 'individual_modules/introduction_to_r/good_practise.ipynb'
60+
- 'individual_modules/introduction_to_r/gettingstarted.ipynb'
6061
- 'individual_modules/regression_analysis_with_R/introduction_to_regression.ipynb'
6162
- 'individual_modules/regression_analysis_with_R/hypothesis_testing.ipynb'
6263
- 'individual_modules/regression_analysis_with_R/multiple_linear_regression.ipynb'

_static/multiple_regression_hyperplane.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

_static/multiple_regression_hyperplane_2.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

_static/workshops_network_hpc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ <h1></h1>
282282

283283

284284
// parsing and collecting nodes and edges from the python
285-
nodes = new vis.DataSet([{"color": "#4682B4", "id": "Introduction to HPC", "label": "Introduction to HPC", "level": 2, "shape": "dot", "size": 10, "title": "Course Name: Introduction to HPC\nCourse Pre-reqs: Introduction to Unix\nSubsequent Courses: Parallel Computing"}, {"color": "#4682B4", "id": "Parallel Computing", "label": "Parallel Computing", "level": 3, "shape": "dot", "size": 10, "title": "Course Name: Parallel Computing\nCourse Pre-reqs: Introduction to HPC\nSubsequent Courses: None"}, {"color": "#4682B4", "id": "Introduction to Unix", "label": "Introduction to Unix", "level": 1, "shape": "dot", "size": 10, "title": "Course Name: Introduction to Unix\nCourse Pre-reqs: None\nSubsequent Courses: Introduction to HPC, Introduction to Version Control with Git and GitHub"}, {"color": "#4682B4", "id": "Introduction to Version Control with Git and GitHub", "label": "Introduction to Version Control with Git and GitHub", "level": 2, "shape": "dot", "size": 10, "title": "Course Name: Introduction to Version Control with Git and GitHub\nCourse Pre-reqs: Introduction to Unix\nSubsequent Courses: Intermediate Version Control"}, {"color": "#4682B4", "id": "Intermediate Version Control", "label": "Intermediate Version Control", "level": 3, "shape": "dot", "size": 10, "title": "Course Name: Intermediate Version Control\nCourse Pre-reqs: Introduction to Version Control with Git and GitHub\nSubsequent Courses: None"}, {"color": "#4682B4", "id": "Introduction to Python", "label": "Introduction to Python", "level": 1, "shape": "dot", "size": 10, "title": "Course Name: Introduction to Python\nCourse Pre-reqs: None\nSubsequent Courses: None"}]);
285+
nodes = new vis.DataSet([{"color": "#FFD700", "id": "Introduction to HPC", "label": "Introduction to HPC", "level": 2, "shape": "dot", "size": 10, "title": "Course Name: Introduction to HPC\nCourse Pre-reqs: Introduction to Unix\nSubsequent Courses: Parallel Computing"}, {"color": "#FFD700", "id": "Parallel Computing", "label": "Parallel Computing", "level": 3, "shape": "dot", "size": 10, "title": "Course Name: Parallel Computing\nCourse Pre-reqs: Introduction to HPC\nSubsequent Courses: None"}, {"color": "#FFD700", "id": "Introduction to Unix", "label": "Introduction to Unix", "level": 1, "shape": "dot", "size": 10, "title": "Course Name: Introduction to Unix\nCourse Pre-reqs: None\nSubsequent Courses: Introduction to HPC, Introduction to Version Control with Git and GitHub"}, {"color": "#FFD700", "id": "Introduction to Version Control with Git and GitHub", "label": "Introduction to Version Control with Git and GitHub", "level": 2, "shape": "dot", "size": 10, "title": "Course Name: Introduction to Version Control with Git and GitHub\nCourse Pre-reqs: Introduction to Unix\nSubsequent Courses: Intermediate Version Control"}, {"color": "#FFD700", "id": "Intermediate Version Control", "label": "Intermediate Version Control", "level": 3, "shape": "dot", "size": 10, "title": "Course Name: Intermediate Version Control\nCourse Pre-reqs: Introduction to Version Control with Git and GitHub\nSubsequent Courses: None"}, {"color": "#FFD700", "id": "Introduction to Python", "label": "Introduction to Python", "level": 1, "shape": "dot", "size": 10, "title": "Course Name: Introduction to Python\nCourse Pre-reqs: None\nSubsequent Courses: None"}]);
286286
edges = new vis.DataSet([{"arrows": "to", "from": "Introduction to HPC", "to": "Parallel Computing", "width": 1}, {"arrows": "to", "from": "Introduction to Unix", "to": "Introduction to HPC", "width": 1}, {"arrows": "to", "from": "Introduction to Unix", "to": "Introduction to Version Control with Git and GitHub", "width": 1}, {"arrows": "to", "from": "Introduction to Version Control with Git and GitHub", "to": "Intermediate Version Control", "width": 1}]);
287287

288288
nodeColors = {};

_static/workshops_network_r_ds.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ <h1></h1>
282282

283283

284284
// parsing and collecting nodes and edges from the python
285-
nodes = new vis.DataSet([{"color": "#FFD700", "id": "Introduction to R", "label": "Introduction to R", "level": 1, "shape": "dot", "size": 10, "title": "Course Name: Introduction to R\nCourse Pre-reqs: None\nSubsequent Courses: Regression analysis with R, Working With Data In R"}, {"color": "#FFD700", "id": "Regression analysis with R", "label": "Regression analysis with R", "level": 2, "shape": "dot", "size": 10, "title": "Course Name: Regression analysis with R\nCourse Pre-reqs: Introduction to R\nSubsequent Courses: Advanced Regression Analysis With R "}, {"color": "#FFD700", "id": "Working With Data In R", "label": "Working With Data In R", "level": 2, "shape": "dot", "size": 10, "title": "Course Name: Working With Data In R\nCourse Pre-reqs: Introduction to R\nSubsequent Courses: None"}, {"color": "#FFD700", "id": "Advanced Regression Analysis With R ", "label": "Advanced Regression Analysis With R ", "level": 3, "shape": "dot", "size": 10, "title": "Course Name: Advanced Regression Analysis With R \nCourse Pre-reqs: Regression analysis with R\nSubsequent Courses: None"}, {"color": "#FFD700", "id": "Introduction to Version Control with Git and GitHub", "label": "Introduction to Version Control with Git and GitHub", "level": 2, "shape": "dot", "size": 10, "title": "Course Name: Introduction to Version Control with Git and GitHub\nCourse Pre-reqs: Introduction to Unix\nSubsequent Courses: Intermediate Version Control"}, {"color": "#FFD700", "id": "Intermediate Version Control", "label": "Intermediate Version Control", "level": 3, "shape": "dot", "size": 10, "title": "Course Name: Intermediate Version Control\nCourse Pre-reqs: Introduction to Version Control with Git and GitHub\nSubsequent Courses: None"}, {"color": "#FFD700", "id": "Introduction to Unix", "label": "Introduction to Unix", "level": 1, "shape": "dot", "size": 10, "title": "Course Name: Introduction to Unix\nCourse Pre-reqs: None\nSubsequent Courses: Introduction to Version Control with Git and GitHub"}]);
285+
nodes = new vis.DataSet([{"color": "#4682B4", "id": "Introduction to R", "label": "Introduction to R", "level": 1, "shape": "dot", "size": 10, "title": "Course Name: Introduction to R\nCourse Pre-reqs: None\nSubsequent Courses: Regression analysis with R, Working With Data In R"}, {"color": "#4682B4", "id": "Regression analysis with R", "label": "Regression analysis with R", "level": 2, "shape": "dot", "size": 10, "title": "Course Name: Regression analysis with R\nCourse Pre-reqs: Introduction to R\nSubsequent Courses: Advanced Regression Analysis With R "}, {"color": "#4682B4", "id": "Working With Data In R", "label": "Working With Data In R", "level": 2, "shape": "dot", "size": 10, "title": "Course Name: Working With Data In R\nCourse Pre-reqs: Introduction to R\nSubsequent Courses: None"}, {"color": "#4682B4", "id": "Advanced Regression Analysis With R ", "label": "Advanced Regression Analysis With R ", "level": 3, "shape": "dot", "size": 10, "title": "Course Name: Advanced Regression Analysis With R \nCourse Pre-reqs: Regression analysis with R\nSubsequent Courses: None"}, {"color": "#4682B4", "id": "Introduction to Version Control with Git and GitHub", "label": "Introduction to Version Control with Git and GitHub", "level": 2, "shape": "dot", "size": 10, "title": "Course Name: Introduction to Version Control with Git and GitHub\nCourse Pre-reqs: Introduction to Unix\nSubsequent Courses: Intermediate Version Control"}, {"color": "#4682B4", "id": "Intermediate Version Control", "label": "Intermediate Version Control", "level": 3, "shape": "dot", "size": 10, "title": "Course Name: Intermediate Version Control\nCourse Pre-reqs: Introduction to Version Control with Git and GitHub\nSubsequent Courses: None"}, {"color": "#4682B4", "id": "Introduction to Unix", "label": "Introduction to Unix", "level": 1, "shape": "dot", "size": 10, "title": "Course Name: Introduction to Unix\nCourse Pre-reqs: None\nSubsequent Courses: Introduction to Version Control with Git and GitHub"}]);
286286
edges = new vis.DataSet([{"arrows": "to", "from": "Introduction to R", "to": "Regression analysis with R", "width": 1}, {"arrows": "to", "from": "Introduction to R", "to": "Working With Data In R", "width": 1}, {"arrows": "to", "from": "Regression analysis with R", "to": "Advanced Regression Analysis With R ", "width": 1}, {"arrows": "to", "from": "Introduction to Version Control with Git and GitHub", "to": "Intermediate Version Control", "width": 1}, {"arrows": "to", "from": "Introduction to Unix", "to": "Introduction to Version Control with Git and GitHub", "width": 1}]);
287287

288288
nodeColors = {};

contributing/contributing_guidelines.ipynb

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,50 @@
3232
"\n",
3333
"These tutorials are distrbuted as an R package [cfrr-r-tutorials](https://github.com/coding-for-reproducible-research/cfrr-r-tutorials) and should be developed in that repo. A homepage, with details on the course and instructions for how to launch the tutorial should be included in this repo. \n",
3434
"\n",
35-
"#### Guidelines for R Courses:\n",
35+
"#### Guidelines for R Courses:xw\n",
3636
"- Use learnr tutorials (`.Rmd` files) for all course materials.\n",
3737
"- All courses will have a pre-requisite that the participants have some familiarity with R, however the precise details to what is this includes will depend on the course , and needs to be defined. \n",
3838
"- Incorporate interactive code exercises and quizzes to reinforce learning.\n",
3939
"- Ensure that tutorials are self-contained and include all necessary data and instructions.\n",
4040
"- Use clear and concise explanations in markdown to guide learners through the content.\n",
4141
"- Test all tutorials to ensure they function correctly and provide accurate feedback.\n",
4242
"\n",
43+
"#### Adding an R Kernel to Jupyter Notebooks\n",
4344
"\n",
45+
"To run the R code within the Jupyter Notebooks used in this repository you will need an R kernel, which you can acquire by following the steps below.\n",
46+
"\n",
47+
"##### Install R\n",
48+
"\n",
49+
"Install R from the official CRAN website: [https://cran.r-project.org/](https://cran.r-project.org/)\n",
50+
"\n",
51+
"Alternatively, on Linux:\n",
52+
"\n",
53+
"```bash\n",
54+
"sudo apt update\n",
55+
"sudo apt install r-base\n",
56+
"```\n",
57+
"\n",
58+
"##### Install IRKernel from R\n",
59+
"\n",
60+
"Open R (in terminal or RStudio) and run:\n",
61+
"\n",
62+
"```r\n",
63+
"install.packages(\"IRkernel\")\n",
64+
"IRkernel::installspec(name = \"ir\", displayname = \"R\")\n",
65+
"```\n",
66+
"\n",
67+
"- `name`: Internal name used by Jupyter\n",
68+
"- `displayname`: Name shown in the Jupyter interface\n",
69+
"\n",
70+
"This will register the R kernel with Jupyter.\n",
71+
"\n",
72+
"##### Verify Installation\n",
73+
"\n",
74+
"Run:\n",
75+
"\n",
76+
"```bash\n",
77+
"jupyter kernelspec list\n",
78+
"```\n",
4479
"\n",
4580
"## Course Delivery\n",
4681
"\n",

individual_modules/advanced_regression_analysis_with_R/advanced_regression_analysis_with_R_extras.ipynb

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
{
22
"cells": [
3-
{
4-
"cell_type": "code",
5-
"execution_count": 1,
6-
"id": "b9ecb632-1728-4245-be1c-649f2165a3fd",
7-
"metadata": {
8-
"editable": true,
9-
"slideshow": {
10-
"slide_type": ""
11-
},
12-
"tags": [
13-
"remove-input"
14-
]
15-
},
16-
"outputs": [],
17-
"source": [
18-
"%load_ext rpy2.ipython"
19-
]
20-
},
213
{
224
"cell_type": "code",
235
"execution_count": 2,
@@ -33,7 +15,6 @@
3315
},
3416
"outputs": [],
3517
"source": [
36-
"%%R\n",
3718
"knitr::opts_chunk$set(echo = TRUE)\n",
3819
"\n",
3920
"nInd<-175\n",
@@ -139,7 +120,6 @@
139120
}
140121
],
141122
"source": [
142-
"%%R\n",
143123
"model.int<-lm(CognitionB ~ VisitNum*Sex, dat = cogDat)\n",
144124
"summary(model.int)"
145125
]
@@ -200,7 +180,6 @@
200180
}
201181
],
202182
"source": [
203-
"%%R\n",
204183
"model.int<-lm(CognitionB ~ VisitNum:Sex, dat = cogDat)\n",
205184
"summary(model.int)"
206185
]
@@ -260,7 +239,6 @@
260239
}
261240
],
262241
"source": [
263-
"%%R\n",
264242
"model.int<-lm(CognitionB ~ Sex + VisitNum:Sex, dat = cogDat)\n",
265243
"summary(model.int)"
266244
]
@@ -308,21 +286,17 @@
308286
],
309287
"metadata": {
310288
"kernelspec": {
311-
"display_name": "Python 3 (ipykernel)",
312-
"language": "python",
313-
"name": "python3"
289+
"display_name": "R",
290+
"language": "R",
291+
"name": "ir"
314292
},
315293
"language_info": {
316-
"codemirror_mode": {
317-
"name": "ipython",
318-
"version": 3
319-
},
320-
"file_extension": ".py",
321-
"mimetype": "text/x-python",
322-
"name": "python",
323-
"nbconvert_exporter": "python",
324-
"pygments_lexer": "ipython3",
325-
"version": "3.9.19"
294+
"codemirror_mode": "r",
295+
"file_extension": ".r",
296+
"mimetype": "text/x-r-source",
297+
"name": "R",
298+
"pygments_lexer": "r",
299+
"version": "4.3.3"
326300
}
327301
},
328302
"nbformat": 4,

individual_modules/advanced_regression_analysis_with_R/advanced_regression_analysis_with_R_summary.ipynb

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,17 @@
4040
],
4141
"metadata": {
4242
"kernelspec": {
43-
"display_name": "Python 3 (ipykernel)",
44-
"language": "python",
45-
"name": "python3"
43+
"display_name": "R",
44+
"language": "R",
45+
"name": "ir"
4646
},
4747
"language_info": {
48-
"codemirror_mode": {
49-
"name": "ipython",
50-
"version": 3
51-
},
52-
"file_extension": ".py",
53-
"mimetype": "text/x-python",
54-
"name": "python",
55-
"nbconvert_exporter": "python",
56-
"pygments_lexer": "ipython3",
57-
"version": "3.9.19"
48+
"codemirror_mode": "r",
49+
"file_extension": ".r",
50+
"mimetype": "text/x-r-source",
51+
"name": "R",
52+
"pygments_lexer": "r",
53+
"version": "4.3.3"
5854
}
5955
},
6056
"nbformat": 4,

0 commit comments

Comments
 (0)