2024-08-20

MTCars Data Explorer

An Interactive Shiny Application

  • Author: Ced
  • Date: August 20, 2024

Introduction

Welcome to the MTCars Data Explorer! This Shiny app allows you to:

  • Visualize relationships between various car attributes.
  • Customize plot appearance (size, color, etc.).
  • Choose between linear and quadratic smooth lines.
  • Filter cars by the number of cylinders.

Explore how different variables relate to one another and gain insights into the MTCars dataset.

Example Visualization

Here is an example of how the app visualizes the relationship between Miles Per Gallon (MPG) and Horsepower (HP), colored by the number of cylinders:

## `geom_smooth()` using formula = 'y ~ x'

Model Selection

The Shiny app allows users to choose between different smooth lines:

Linear Model:
fit_linear <- lm(hp ~ mpg, data = mtcars)
Quadratic Model:
fit_quadratic <- lm(hp ~ poly(mpg, 2), data = mtcars)