Module 1: Basic toolset
Day 1: Morning - Computers in general, files and the terminal
Schedule:
What | When |
---|---|
Start | 09:00 |
End / lunch | 11:45 |
Material
- General introduction
- Discussion on scientific activities and computers
- Terminal, git and bash essentials
Slides
Day 1: Afternoon - R
Schedule:
What | When |
---|---|
Start | 13:00 |
End | 17:15 |
Pizza! | 17:30 |
50 Minutes of class and 10 minutes of break every hour.
Material
- Demonstration code and project (1_corals_demo.R)
- Michal Kowalewski’s R quiz (30 min, silent work on paper!)
- Solutions (~1h)
- Exercise on the penguins data (Example exercise)
Goodies
Markdown
Markdown is a very simple markup ‘language’ that can be very easilly translated into any other kind of document, such as webpages (html) and pdfs. It is used in web design, programming documentation and tutorials - as well as for taking notes. If you aare not familiar with markdown, you are highly suggested to check it out (just google 'markdown'
and you will find a ton of material, here is a Markdown Cheat sheet). You are also welcome to do the following formatting tutorial:
Markdown is often used for literate programming, i.e. for writing tutorials and research logs. A dialect of markdown, Quarto is especially efficient at writing good scientific documentation. Feel free to give it a try and play around with it if you haven’t yet!
Papers
- Cooper and Hsing, 2017 - Reproducible code
- Wilkinson et al. 2016 - FAIR principles
Learning the terminal and git
- Unix Workbench coursera course
- The Missing Semester of Your CS Education
Making a website with academicpages
- Go to Acadmic pages (example jekyll), and fork the repository!
- Go to your forked version of the repository. Go to
Settings
, and then toPages
(currently under the sectionCode and automation
). - Under
Build and deployment
select the source: Build from a branch. And in Branch selectmaster
, and/root
and hit save. - The page will take some time to build. If you go on the repository’s main page, there will be an orange dot next to the commit hash. When the page is ready, this will change to a green checkmark.
- If you go the settings page where you set up the things above, you should see the URL to the webpage. This URL will typicall be:
https://<yourgithubname>.github.io/<reponame, i.e. academicpages>/
. - If you want to make a webpage with the URL
https://<yourgithubname>.github.io/
, you have to create a repository called<yourgithubname>.github.io
. - You can also set up a custom domain for this page. See this article to find out how.
Books on R
Some missing notes
Wrtiting shell scripts
(BASH) Shell scripts can be run directly with the bash
console application: If your code file is called my_code.sh
(.sh is the typical extension for shell scripts) you can run it with:
bash my_code.sh
Alternatively, you can make the file a proper executable. For that it has to start with a ‘shebang’, which is a commented line that looks like this:
#!/bin/bash
Then you need to change its mode to become executable with:
chmod +x my_code.sh
which you can confirm with ls -l
. Once the file is executable, you can run it by typing in its path to the console. For files in your current working directory, you have to point to the current working directory:
./my_code.sh
Or you have to add the file’s directory to the PATH
environment variable.