[1] 253
Applied Data Science - Session 3
Europa-Universität Flensburg
2026-09-28
tidyverse styleTwo weeks with no class — 5 and 12 October
Report 1 will not fill both — use them for recap.
Four-star hotels, centre against 1–2 km out: €43 more per night.
How do you write it down so it is still right after the data changes?
And at the end: Report 1.
YAML header — settings for the whole document
Text — prose, in Markdown
Code chunks — R that runs when the document is built
Plus inline code — a computed value inside a sentence
Where the file sits is important
Usually the project root is easiest, reports/ subdirectory for larger projects.
| You type | You get |
|---|---|
## Findings |
a section heading |
**central** |
central |
*roughly* |
roughly |
- one - two |
a bulleted list |
[Moodle](https://...) |
a link |
`price` |
price — code, not prose |
Best learned on the go — there is a command for everything.
[1] 253
| Option | Effect |
|---|---|
echo: false |
run it, show only the output |
eval: false |
show it, do not run it |
include: false |
run it, show nothing — the setup chunk |
label: |
a name, needed for cross-references |
Per chunk — or document-wide, in the YAML execute: block.
Always first, always the same shape:
It always dependeds on your environment, never on the file.
View() is for you, now — not for the document
head(), or a flextablehere-packagelibrary()setwd()View(), no install.packages()Session → Restart R, then Render
Twenty seconds. The difference between reproduces and reproduced once.
Before every submission.
here()Relative to the project, not the document. Nothing machine-specific written down.
From today, the standard
Survives your .qmd moving into a subfolder. Report 1 asks for it.
One line, in your setup chunk, above everything else:
here() otherwise guesses the root — and guesses silentlyi_am() states it. No .Rproj needed.First line of every document
Every file with paths. All semester. Report 1 included.
Compare the two paths. That is the whole diagnosis.
Your choice now — paths no longer depend on it.
reports/.qmd in the root is a root you cannot readName it for the contents
You would not call data/ “readr”.
The fix is not “be more careful”
Keep one copy. Let the document compute the rest.
Written badly:
We analysed 253 hotels in Vienna.
Written properly — same on the page, different in the source:
We analysed 253 hotels in Vienna.
Every number in your prose is inline R code
Not one typed digit. All semester, all three reports.
Give it a name instead.
@fig-bands in the text → a live, numbered reference: As Figure 1 shows…
fig- or tbl-Captions for a flextable
From #| tbl-cap:, never from flextable().
Write [@bekes2021data] → (Békés and Kézdi 2021), plus a bibliography of only what you cited.
Google Scholar → the quotation-mark icon → BibTeX. Check what you paste.
Zotero and other bib managers export bib entries!
.qmd, different format:format: |
You get |
|---|---|
html |
a web page — the default, and enough for Report 1 |
pdf |
a document for printing — needs LaTeX, once |
docx |
Word, for the co-author who insists |
revealjs |
these slides |
Second entry → the Render button grows a dropdown.
Before you try PDF
quarto install tinytex in the terminal, once.
You built it in the console. The render has never seen it.
Restart R, render. Whatever breaks is what is missing from the file.
Base R speaks German, the tidyverse does not
Error: object 'four_star' not found — same error, English install.
The best error message you will get all semester — it prints where it looked.
Compare that folder with where the file is. Then i_am().
It names the line and points a ~ at the spot. Look one line further in.
A tab instead of spaces says so explicitly: tab characters must not be used.
? = the reference found nothing to point atfig- / tbl-The dangerous class of bug
Read the output, not just the render log.
HTML is enough. PDF only if you already have LaTeX.
Start it this week
Not because it is long — the first render elsewhere is the one that fails.
Session 4: Git and GitHub — version control without the command line.
Applied Data Science 2026 | Session 3