Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, September 5, 2019

Codecademy Aggregates in R Calculating Aggregate Functions I 3/7


#Sample Solution
---
title: "Aggregates in R"
output: html_notebook
---

```{r message = FALSE}
# load packages
library(readr)
library(dplyr)
```

```{r message = FALSE}
# load orders data
orders <- read_csv("orders.csv")

# inspect orders
head(orders)
```

```{r}
# define pricey_shoes here:
pricey_shoes <- orders %>% group_by(shoe_type) %>% summarize(pricey_shoes=max(price,na.rm=TRUE))
pricey_shoes
```

```{r}
# define shoes_sold here:
shoes_sold <- orders %>% group_by(shoe_type) %>% summarize(shoes_sold=n())
shoes_sold
```

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts