Day 1 — Plain text, Word and Excel
Did a treatment make seedlings grow more? The measurements are in a file. Some kinds of files any program can read; others only one program understands, and some programs change your data without asking. Which kind of file should hold our measurements?
Today you will:
No programming today. Every later day reads and writes plain-text files.
introcomputing-course to Documents.Work in the extracted folder, not inside the ZIP.
seedlings.csv: a header line, then one line per plant. P01 grew 44.3 − 25.7 = 18.6 mm..docx and .xlsx are ZIP packages. PDF and PNG files are not text either.
We keep data as CSV: every program reads it, and nothing is hidden.
Never save raw data from a spreadsheet. Close it without saving.
Look at a CSV in a text editor before you analyse it.
Write code, data and notes in a text editor (later, RStudio), not in Word.
Renaming changes the name, not the contents. Converting needs Save As.
Copy data/seedlings.csv to output/seedlings-practice.csv. Experiment only on copies.
Save reports/day01-notes.txt. Check that the name ends in .txt, not .rtf. Close the editor, then reopen the note from its folder.
.docx in Notepad and see PK and symbols. Is it broken?seedlings.csv or seedlings.xlsx?1-Mar. What happened?P01;control;25,7;44,3. Where does it come from?.csv, .txt, .R, .Rmd, .md) is just characters: any editor shows it, R reads it..docx and .xlsx are ZIP packages; PDF and images are not text either..xlsx adds formatting, formulas and sheets. We keep data as CSV." into “ ”. Write code in a text editor.Next (Day 2, folders and paths): writing down exactly where a file is.
Now: open the Day 1 exercises. Leave with reports/day01-notes.txt, reports/file-types.txt and output/seedlings-practice.csv.