#Sample Solution
---
title: "Joining Tables in R"
output: html_notebook
---
```{r message = FALSE}
# load packages
library(readr)
library(dplyr)
```
```{r message = FALSE}
# load orders and products data
orders <- read_csv("orders.csv")
products <- read_csv("products.csv")
```
```{r}
# inspect orders and products
head(orders)
head(products)
```
```{r}
# rename the id column of products here:
products <- products %>% rename(product_id = id)
products
```
```{r}
# define orders_products here:
orders_products <- orders %>% inner_join(products)
orders_products
```
No comments:
Post a Comment