This is a first attempt of an R Markdown document for Nick
Gray.
Below is his attempt at Assignment 1 from STATS 330.
sales_data <- read_csv('sales_quantity.csv')
## Rows: 261 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): line, item, season_released
## dbl (2): price, quantity_sold
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
sales_data
## # A tibble: 261 × 5
## line item price quantity_sold season_released
## <chr> <chr> <dbl> <dbl> <chr>
## 1 cyberpunk Neochromic Netrunner Coat 211 46 Spring/Summer
## 2 cyberpunk Cybernetic Corset 156 117 Spring/Summer
## 3 cyberpunk Dataspike Dress 203 112 Fall/Winter
## 4 cyberpunk Neurohacker Hoodie 50 62 Spring/Summer
## 5 cyberpunk Nanoweave Jumpsuit 144 0 Spring/Summer
## 6 cyberpunk Digital Divinity Cloak 165 60 Spring/Summer
## 7 cyberpunk Megadata Miniskirt 34 150 Fall/Winter
## 8 cyberpunk Cyberpunk Corset Top 25 203 Fall/Winter
## 9 cyberpunk Glitchtech Gloves 25 214 Fall/Winter
## 10 cyberpunk Neurotoxin Leggings 35 140 Fall/Winter
## # ℹ 251 more rows
A box plot displays a median line to indicate the central price of all sales for a given line. Each lines sales is split by season to identify differences worth investigating.
# Show scatter plots for each line to investigate price vs volume
ggplot(sales_data, aes(x=quantity_sold, y=price, color=season_released)) +
geom_point() +
facet_wrap(~line) +
scale_y_log10()
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.