Hands-on exercise

Tidy up a study folder and create a data package

A hands-on exercise in folder structure and file naming, using real, openly published data from a pediatric oncology study. You get a folder of data files and turn it into a well-organised data package.

⏱ 20 minutes (+5 optional) 📊 Based on real open data (CC BY 4.0) ✍️ Author: Paula Ramos-Silva
0 of 5 steps done

The study

In the Bern-Basel 2021 wearable device pilot (project code BBWDP), 20 children receiving chemotherapy wore two wearable devices, the CORE® and the Everion®, for 14 days. Both devices measured core temperature every minute, so that fever could be detected early.

You get part of the published data: device data from two patients, the clinical data for all patients (as exported, and a cleaned version without double entries), three data dictionaries that describe the variables, and two R scripts: one that exported the device data and one that cleaned the clinical data. All files sit together in one folder, BBWDP_data, with names like CORE_data.patient_01.csv and script.R. Your job is to organise them into a clear structure with a consistent naming convention, so that anyone can find their way around.

The data are real and openly published under CC BY 4.0 (Farner et al., 2024, figshare; Koenig et al., 2024, Supportive Care in Cancer). The published files are used unchanged; only a subset is used, and the export script was renamed. The cleaned clinical file and its cleaning script were made for this workshop.

By the end of this exercise you can

Step 1

Download and explore the files

  1. Download BBWDP_data.zip and unzip it.
  2. Open the folder BBWDP_data and look at the eleven files without opening the files. Which ones do you think are raw data, processed data, documentation or code?
  3. Would a new colleague understand these names without help? What would you improve?
Step 2

Create a folder structure

Download the template and rename PROJECTCODE_project/ to BBWDP_project/. In it, replace projectcode by bbwdp and move the files from BBWDP_data into the right folder.

BBWDP_project/
├── 01_bbwdp_data/
│   ├── raw/              data as collected – never edit
│   └── processed/        data made from raw data by a script
├── 02_bbwdp_scripts/     data analysis scripts
└── 03_bbwdp_docs/        documentation: data dictionaries
Hint: Why separate raw and processed data?

Raw data is your only source of truth. If you keep it apart and never edit it, you can always redo the processing, for example by running cleaning_script.R again. Some researchers even make the raw folder read-only.

Hint: Why the numbers in front of the folder names?

Numbers make folders sort in a logical order instead of alphabetically. Always use two digits (01, not 1), so 10_ doesn't end up between 1_ and 2_.

Step 3

Rename and move the files

Give at least three files a name that follows this convention:

bbwdp_description_vNN.ext

ElementRuleExample
Project codeAlways bbwdp, in lowercasebbwdp
Description1–4 words, lowercase, separated by hyphens -. No vague words like final or old.core-patient01
Versionv followed by two digitsv01

Elements are separated by underscores _. No spaces, no special characters. Keep the extension (.csv, .R) as it is.

Since this is the first version of every file, they all get v01.

🔍 Try a file name

Hint: Why is there no date in the name?

Many projects start file names with a date (YYYYMMDD) so files sort in time order. These data are de-identified: real dates were replaced by study days. So the convention for this project leaves the date out.

Hint: What's a good description for the Readme files?

Say what they are and what they describe, for example data-dictionary-core. Then everyone can see at a glance which data file the data dictionary belongs to.

Hint: What happens to the scripts when I rename files?

Scripts refer to files by name. Open cleaning_script.R in a text editor: at the top, input_file and output_file still use the old names. After renaming, those lines need updating before the script works again. You don't have to do that now: just remember that renaming has consequences for code, so agree on names early in a project.

Step 4

Check your work

Select your newly organized BBWDP_project folder. The checker looks at the structure, the file names, and whether each file ended up in the right place.

Everything happens in your browser. Your files are not uploaded anywhere.
Your browser may ask whether you want to "upload" the files. That's just its standard wording; nothing leaves your computer.
Step 5

Compare with the model solution

There is more than one good answer. Compare your version with ours.

Show the model solution

      

📦 Download solution.zipIncludes a completed README.txt

Reflect

Optional extra

Write a README

Tidy names help, but a README tells the rest of the story. Copy README-template.txt from the template to the top of BBWDP_project, rename it to README.txt, and fill it in:

Hint: Where do I find this information?

Use the study description at the top of this page and the links to the article and the data. For the file formats, look at the file extensions.

Then run the checker in step 4 again: it also looks for the README. Compare yours with the README in solution.zip.