| Title: | Data on Cars in Qatar |
|---|---|
| Description: | Fuel economy, size, performance, and price data for cars in Qatar in 2025. Mirrors many of the columns in mtcars, but uses (1) non-US-centric makes and models, (2) 2025 prices, and (3) metric measurements, making it more appropriate for use as an example dataset outside the United States. For more details see Musgrave (2025) <doi:10.1080/15512169.2025.2572320>. |
| Authors: | Paul Musgrave [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-8984-4992>), Andrew Heiss [aut] (ORCID: <https://orcid.org/0000-0002-3948-3914>) |
| Maintainer: | Paul Musgrave <[email protected]> |
| License: | CC BY 4.0 |
| Version: | 1.1.0 |
| Built: | 2026-05-14 05:13:24 UTC |
| Source: | https://github.com/profmusgrave/qatarcars |
Functions to convert between Qatari Riyals (QAR), US Dollars (USD), and Euros (EUR) using exchange rates from the time of data collection in January 2025.
qar_to_usd(qar) qar_to_eur(qar) usd_to_qar(usd) usd_to_eur(usd) eur_to_qar(eur) eur_to_usd(eur)qar_to_usd(qar) qar_to_eur(qar) usd_to_qar(usd) usd_to_eur(usd) eur_to_qar(eur) eur_to_usd(eur)
qar |
numeric vector of values in Qatari Riyals |
usd |
numeric vector of values in US Dollars |
eur |
numeric vector of values in Euros |
Exchange rates in January 2025:
1 USD = 3.64 QAR
1 EUR = 4.15 QAR
Numeric vector of converted currency amounts
qar_to_usd(100) usd_to_eur(50) eur_to_qar(25) qatarcars$price_eur <- qar_to_eur(qatarcars$price) qatarcars$price_usd <- qar_to_usd(qatarcars$price) qatarcars[, c("origin", "make", "model", "price", "price_eur", "price_usd")] # Labels are updated automatically str(qatarcars$price) str(qatarcars$price_eur) str(qatarcars$price_usd) if (require("dplyr")) { qatarcars |> mutate( price_eur = qar_to_eur(price), price_usd = qar_to_usd(price) ) |> select(origin, make, model, starts_with("price")) }qar_to_usd(100) usd_to_eur(50) eur_to_qar(25) qatarcars$price_eur <- qar_to_eur(qatarcars$price) qatarcars$price_usd <- qar_to_usd(qatarcars$price) qatarcars[, c("origin", "make", "model", "price", "price_eur", "price_usd")] # Labels are updated automatically str(qatarcars$price) str(qatarcars$price_eur) str(qatarcars$price_usd) if (require("dplyr")) { qatarcars |> mutate( price_eur = qar_to_eur(price), price_usd = qar_to_usd(price) ) |> select(origin, make, model, starts_with("price")) }
The official colors of the Qatari flag are white and Pantone 1955 C, or
"Qatar maroon." The hex representation of this color is #8A1538.
qatar_maroonqatar_maroon
A character string containing a hex color code.
https://en.wikipedia.org/wiki/Flag_of_Qatar
qatar_maroon hist(qatarcars$length, breaks = 15, col = qatar_maroon, border = "white") if (require("ggplot2")) { ggplot(qatarcars, aes(x = length)) + geom_histogram(bins = 15, fill = qatar_maroon, color = "white") }qatar_maroon hist(qatarcars$length, breaks = 15, col = qatar_maroon, border = "white") if (require("ggplot2")) { ggplot(qatarcars, aes(x = length)) + geom_histogram(bins = 15, fill = qatar_maroon, color = "white") }
Includes prices and other specifications taken from YallaMotors Qatar between January to August 2025
qatarcarsqatarcars
A tibble with 105 rows and 15 variables:
a factor denoting car country of origin
a factor denoting car make
a factor denoting car model
a number denoting car length (meters)
a number denoting car width (meters)
a number denoting car height (meters)
a number denoting number of seats in car
a number denoting volume of trunk (liters)
a number denoting car fuel economy (L/100km)
a number denoting car horsepower
a number denoting car price (2025 Qatari riyals (QAR))
a number denoting car mass (kilograms)
a number denoting car performance (Time 0-100 km/h (seconds))
a factor denoting car type
a factor denoting car engine type
https://github.com/profmusgrave/qatarcars
https://open.substack.com/pub/musgrave/p/introducing-the-qatar-cars-dataset
Yalla Motors Qatar
str(qatarcars) head(qatarcars) summary(qatarcars) table(qatarcars$origin) aggregate(price ~ enginetype, qatarcars, mean) barplot(table(factor( qatarcars$seating, levels = min(qatarcars$seating):max(qatarcars$seating) ))) plot(economy ~ mass, qatarcars) plot(price ~ performance, qatarcars, log = "y") if (require("dplyr")) { glimpse(qatarcars) } if (require("dplyr")) { qatarcars |> count(origin) } if (require("dplyr")) { qatarcars |> group_by(enginetype) |> summarize(avg_price = mean(price)) } if (require("ggplot2")) { ggplot(qatarcars, aes(x = seating)) + geom_bar() } if (require("ggplot2")) { ggplot(qatarcars, aes(x = mass, y = economy)) + geom_point() } if (require("ggplot2")) { ggplot(qatarcars, aes(x = performance, y = price)) + geom_point() + scale_y_log10() }str(qatarcars) head(qatarcars) summary(qatarcars) table(qatarcars$origin) aggregate(price ~ enginetype, qatarcars, mean) barplot(table(factor( qatarcars$seating, levels = min(qatarcars$seating):max(qatarcars$seating) ))) plot(economy ~ mass, qatarcars) plot(price ~ performance, qatarcars, log = "y") if (require("dplyr")) { glimpse(qatarcars) } if (require("dplyr")) { qatarcars |> count(origin) } if (require("dplyr")) { qatarcars |> group_by(enginetype) |> summarize(avg_price = mean(price)) } if (require("ggplot2")) { ggplot(qatarcars, aes(x = seating)) + geom_bar() } if (require("ggplot2")) { ggplot(qatarcars, aes(x = mass, y = economy)) + geom_point() } if (require("ggplot2")) { ggplot(qatarcars, aes(x = performance, y = price)) + geom_point() + scale_y_log10() }