| Title: | Quebec Data and Tools for Introductory Data Science |
|---|---|
| Description: | Historical weather observations and food-establishment conviction records from Quebec for teaching data import, missing values, exploratory analysis and reproducible reporting. Includes bilingual prompts and feedback for a penguin data-cleaning exercise, and an optional static R code-style diagnostic based on 'lintr'. Data are distributed as fixed teaching snapshots and require no network access during use. |
| Authors: | Aurélien Nicosia [aut, cre] |
| Maintainer: | Aurélien Nicosia <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.0 |
| Built: | 2026-10-03 14:03:27 UTC |
| Source: | https://github.com/aureliennicosiaulaval/ulavalssd |
Retrieve one of four prompts used in the STT-1100 penguin exercise. French is the default to preserve existing course code.
consulter_taches(section, lang = "fr")consulter_taches(section, lang = "fr")
section |
One character string, exactly one of |
lang |
Message language: |
A character string containing the exercise prompt.
consulter_taches("histogramme") consulter_taches("statistiques_descriptives", lang = "en")consulter_taches("histogramme") consulter_taches("statistiques_descriptives", lang = "en")
Inspect R code without executing it, using a fixed set of 'lintr' checks. The result is a formative indicator, not a validated grade or a measure of statistical correctness. Project-specific '.lintr' settings are ignored.
eval_tidyverse_style(file_path)eval_tidyverse_style(file_path)
file_path |
Path to an existing UTF-8 |
Each of seven observable criteria receives 2 points if its linters
report no issue and 0 otherwise. total rescales these points to 0–20.
coherence and commentaires are always NA: meaningful comments and
reasoning require human review. Empty, comment-only or syntactically
invalid code receives NA for every score and for total.
In Quarto documents, only fenced R chunks are inspected. Backtick and tilde
fences of at least three characters, with up to three leading spaces, are
supported. Prose, inline R, chunk options and other languages are excluded.
An unclosed R fence is an error. Diagnostic line numbers refer to the
original file. Chunks are inspected statically even when eval: false.
The criteria cover indentation; operator, comma and parenthesis spacing;
80-character lines; assignment with <-; snake-case object names; braces;
and trailing whitespace and semicolons. A criterion with no applicable
construct has no reported issue. The score therefore cannot compare the
difficulty or completeness of different submissions.
A list with scores (the nine named criteria retained from earlier
versions), total, max_total (20), status ("ok", "empty", or
"parse_error"), and diagnostics, a data frame of line, column, type,
message and linter. The optional package 'lintr' must be installed.
if (requireNamespace("lintr", quietly = TRUE)) { path <- tempfile(fileext = ".R") writeLines(c("daily_mean <- mean(c(2, 4, 6))", "print(daily_mean)"), path) result <- eval_tidyverse_style(path) result$total unlink(path) }if (requireNamespace("lintr", quietly = TRUE)) { path <- tempfile(fileext = ".R") writeLines(c("daily_mean <- mean(c(2, 4, 6))", "print(daily_mean)"), path) result <- eval_tidyverse_style(path) result$total unlink(path) }
A fixed teaching snapshot of 1,712 records published from 2023-02-13 to 2025-02-10. Original text fields, missing values and column order remain for exercises in importing, cleaning and summarising administrative data.
listecondamnationlistecondamnation
A data frame with classes tbl_df, tbl, and data.frame,
containing 1,712 rows and 10 columns:
Operator name, character.
Business name, character; may be missing.
Description of the offence, character.
Address of the offence, character.
Establishment type, character.
Offence date, POSIXct in UTC.
Judgment date, POSIXct in UTC.
Publication date, POSIXct in UTC.
Fine amount as originally formatted text, not numeric.
Legislative reference, character; may be missing.
Rows are records, not necessarily unique establishments. This historical extract is not an inventory of all establishments or inspections and cannot estimate the probability of an offence. It does not describe present-day operating conditions. No automatic update is performed. The maintainer confirms that all records originate from the official MAPAQ dataset. The original extraction date and preparation script are not recorded.
Gouvernement du Quebec, Ministere de l'Agriculture, des Pecheries et
de l'Alimentation (MAPAQ), via Donnees Quebec. The source catalogue lists
the data under Creative Commons Attribution 4.0 International (CC BY 4.0).
https://www.donneesquebec.ca/recherche/dataset/condamnations-des-etablissements-alimentaires-et-condamnations-concernant-le-bien-etre-des-anim.
See the installed COPYRIGHTS file for attribution and provenance limits.
records <- as.data.frame(listecondamnation) range(as.Date(records$Date_publication)) sort(table(records$Type_etablissement), decreasing = TRUE)records <- as.data.frame(listecondamnation) range(as.Date(records$Date_publication)) sort(table(records$Type_etablissement), decreasing = TRUE)
A fixed teaching snapshot of 20,111 daily records, from 1970-01-01 to 2025-01-22 inclusive. Missing observations are retained for data-cleaning exercises. Values, column order and original classes are preserved from version 0.2.1 for compatibility with existing course materials.
MeteoQuebecMeteoQuebec
A data frame with classes spec_tbl_df, tbl_df, tbl, and
data.frame, containing 20,111 rows and 11 columns:
Numeric row identifier in the original export, not a weather measurement.
Year, numeric.
Month as a two-character string, "01" to "12".
Day as a two-character string, "01" to "31".
Daily maximum temperature, degrees Celsius.
Daily mean temperature, degrees Celsius.
Daily minimum temperature, degrees Celsius.
Daily total precipitation, millimetres.
Daily rainfall, millimetres.
Daily snowfall, centimetres.
Snow on the ground, centimetres.
All measurement columns are numeric and may contain NA. Dates have no
gaps or duplicates, but this does not imply complete measurements.
The original teaching snapshot was attributed to 'weathercan'. An independent reconstruction on 2026-09-22 matched all 11 columns, including missing values, using the ECCC GeoMet climate-daily service: station 5251 (climate identifier 7016294) through 1995-12-31, then station 26892 (701S001) from 1996-01-01. The original extraction date is unknown; the reconstruction and a source manifest are provided in the repository. It establishes the contents, not the homogeneity of the climate series. Station changes and missing observations require further assessment before trend estimation. Rain, snowfall and snow-depth measurements are missing for substantial portions of the series. There is no automatic refresh.
Data source: Environment and Climate Change Canada (ECCC).
Daily observations were independently retrieved and verified on 2026-09-22:
https://api.weather.gc.ca/collections/climate-daily.
Reproduced under the ECCC Data Services End-use Licence:
https://eccc-msc.github.io/open-data/licence/readme_en/.
The package is not endorsed by ECCC. See the installed COPYRIGHTS file.
weather <- as.data.frame(MeteoQuebec) weather$date <- as.Date(with(weather, paste(year, month, day, sep = "-"))) range(weather$date) colSums(is.na(weather)) head(weather[c("date", "min_temp", "max_temp")])weather <- as.data.frame(MeteoQuebec) weather$date <- as.Date(with(weather, paste(year, month, day, sep = "-"))) range(weather$date) colSums(is.na(weather)) head(weather[c("date", "min_temp", "max_temp")])
Return fixed feedback for the two deliberately altered rows in the course
file manchots_donnees.xlsx (also named penguins_mission in exercises).
This function does not inspect data or perform statistical outlier detection.
verifier_valeur_aberrante(ligne, lang = "fr")verifier_valeur_aberrante(ligne, lang = "fr")
ligne |
One finite positive whole number, giving the row in the original exercise file, before filtering or reordering. |
lang |
Message language: |
The answer key corrects row 6 to a flipper length of 193 mm and row 11 to a body mass of 3300 g (3.3 kg) and a bill length of 37.8 mm. Feedback for any other row means only that it is absent from this answer key. It does not establish that an observation is statistically typical. The exercise file is distributed with the course, not with this package.
A character string containing answer-key feedback.
verifier_valeur_aberrante(6) verifier_valeur_aberrante(11, lang = "en")verifier_valeur_aberrante(6) verifier_valeur_aberrante(11, lang = "en")