Assignment 1: Clinical Dosing Sequence Script

Write and submit your first completely standalone R script to build structured medical data vectors and functional math routines.

Your First Independent Program

Now that you have worked in the guided sandbox of swirl, it is time to step out into your own workspace. Writing code completely from scratch forces you to handle the directory setup and syntax structure yourself—the hallmark of an independent data scientist.

The Challenge Scenario

You are designing an experimental computational trial where a cohort of 5 clinical research patients are given stepped doses of a biomarker modifier across a 24-hour cycle. You must generate vectors to systematically track their IDs, timestamps, and target medication volumes.

Script Formatting Checklist

Ensure your script utilizes standard variable formatting (use the <- arrow operator for assignment), contains clean documentation lines prefixed with # symbols, and accurately maps vector collections sequentially.

Practical Assignment

Instructions:
1. Open RStudio and create a new blank script file via File -> New File -> R Script.
2. Save the empty file immediately as 'dosage_protocol.R'.
3. Create a vector variable named 'patient_ids' using the c() function containing the strings: 'PT01', 'PT02', 'PT03', 'PT04', 'PT05'.
4. Create a numerical vector sequence named 'hour_intervals' from 0 to 24, incremented by steps of 6 hours (Hint: use the seq() function with a 'by' argument).
5. Create a numeric vector named 'base_dosage' containing the values: 10, 20, 30, 40, 50. Multiply 'base_dosage' by a scalar constant multiplier of 1.5 to calculate the active payload and save the result to a vector named 'active_dosage'.
6. Print all three final vector arrays explicitly to your console output.

Proof of Work: Run your complete script. Your environment passes checking parameters if your printed 'active_dosage' vector calculates precisely to: [1] 15.0 30.0 45.0 60.0 75.0

Lesson Metadata

Duration: 30 mins
Module Scope: Bioinformatics Bootcamp 2026: Computational Thinking for Biomedical Research