---
title: "Lecture 1: Introduction - Code Examples"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# Code Examples from Lecture 1

## Loading the Dataset

```{r load-packages}
# Install and load required packages
# install.packages("mosaicData")
library(mosaicData)
library(tidyverse)
```

## Data Preparation

```{r data-prep}
# Select and rename columns as shown in lecture
sh = SaratogaHouses %>%
  select(price,
         livingArea,
         age,
         bedrooms,
         bathrooms,
         heating,
         new = newConstruction)
```

## Examine Data Structure

```{r examine-structure}
# Basic data exploration
head(sh)
str(sh)
summary(sh)
```
