INBO coding club: share digital skills in a welcoming environment
Welcome! We’re glad you are interested in our exploration of R, coding and data analysis. The coding club is an environment where we experiment together, share code and learn from each other. Everyone has an equal say and can express themselves freely. We are convinced that everyone can learn from each other, irrespective of the experience. As a particant, we ask you to check and respect our code of conduct.
This page provides the information for first-time participants as well as some information to get you started for each new session. If anyhting is missing in these instructions, please raise a New issue on GitHub or adapt the notes directly.
File
and choose New Project...
New directory
New project
coding-club
. You can choose the location on your computer (Create project as subdirectory of:
) yourself by browsing to a folder. Leave the options Create git repository
and use packrat with this project
empty.
Create project
(Rstudio will now open in the newly created project)Console
: install.packages("tidyverse")
and clicking ENTER button.
Files
pane), navigate to your coding-club
folder and create two (empty) subfolders inside the directory of your new coding-club
directory:
data
src
When done, the coding club folder on your computer should look like:
├── coding-club.Rproj
├── data
└── src
Note for git-users: When familiar with Git, you can setup a coding club using the git-integration of Rstudio. Go to File
and choose New Project...
. Pick Version control
, next Git
and fill in the URL of the coding club in the Repository URL
: https://github.com/inbo/coding-club
coding-club
:
File
and choose Open Project...
coding-club
foldercoding-club.Rproj
To complete the challenges, both data sets and R code are used in the sessions:
data/yyyymmdd
foldersrc/yyyymmdd
folderThe links to the data sets and source code will be provided, e.g. this script. For all type files except csv
, tsv
(i.e. text files with extensions different than txt
):
Raw
or Download
Save link as
(or Link opslaan als)src
or data
) and save the fileFor csv or tsv (all text files with extension not txt
):
Raw
or Download
.Open as new tab
(or Link openen in nieuw tabblad)Save page as
(or Pagina opslaan als
)src
or data
) and save the fileWe wrote an R function to help you downloading all material you need. In your coding-club
project: just run inborutils::setup_codingclub_session()
. For downloading a past coding club edition pass the date in the "yyyymmdd"
format to the function.
Note for git-users: You can do git pull origin master
(or click the pull
button in the git tab) to download the new material.
Each coding club session focuses on a specific theme with a number of challenges to solve. Altough we aim to solve these challenges by the end of the session, learning from each other is the main purpose. To achieve this, we use our home-brew sticky note concept:
The power of TAB button: When writing code in Rstudio, you can use the TAB keyboard-button to autocomplete variables and function names!
No more setwd
: By using the Rstudio projects, you no longer need to use setwd()
, or full file paths inside read_csv()
-like functions. Instead, you can use a relative file path, e.g. read_csv("data/mydatafile.csv)
instead of read_csv("C://users/AnakinSkywalker/Documents/coding-club/data/mydatafile.csv)
. As such, it becomes much easier to share your code with others (having another folder structure on their computer). In case you need to refer to a parent folder using relative links, use two dots ../folder-name
to go up one folder level. Don’t forget the power of the TAB button as well, as Rstudio will autocomplete file/folder names as well.