Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @wch,
I added a conversion of the base R
cars
dataset into SI units and included the conversion script in my repository: https://github.com/UniversidadNacionalAsuncion/Modelos_Lineales_Generalizados/blob/main/Regresi%C3%B3n%20Lineal%20con%20R/mbayru-script.RSummary of what the script does
cars
fromdatasets::cars
.speed_ms
= speed (mph) × 0.44704 → meters/seconddist_m
= dist (ft) × 0.3048 → metersmbay_ruguata.R
that definesmbay_ruguata <- data.frame(...)
with the SI columns.source('mbay_ruguata.R')
.Why I recommend accepting this change
speed
anddist
is unaffected.Technical notes / transparency
mph_to_ms <- 0.44704
(1 mph = 0.44704 m/s)ft_to_m <- 0.3048
(1 ft = 0.3048 m)mbay_ruguata
and writes only the SI columns intombay_ruguata.R
. If you prefer:data/cars
file so the dataset in-place contains both unit systems.speed_m_s
/dist_m
vsspeed_ms
/dist_m
orspeed_si
/dist_si
), tell me which you prefer and I’ll update the PR accordingly.Requested action
cars
users can immediately work in SI units without extra steps. If you want a different output format or naming convention, I can update the PR right away.Thanks for maintaining this important resource — small improvements like this have a big impact for teaching and reproducible workflows.
Best,
Derlis Sosa
[email protected]