In addition to using inner_join()
to join two data frames together, we can use the pipe %>%
to join multiple data frames together at once. The following command would join orders
with customers
, and then join the resulting data frame with products
:
big_df <- orders %>% inner_join(customers) %>% inner_join(products)
Instructions
We have some more data from Cool T-Shirts Inc. The number of men’s and women’s t-shirts sold per month is in a file called men_women_sales.csv
. Load this data into a data frame called men_women
, and inspect it using head()
.
Join all three data frames (sales
, targets
, and men_women
) into one big data frame called all_data
. View all_data
.
Cool T-Shirts Inc. thinks that they have more revenue in months where they sell more women’s t-shirts.
Filter the rows of all_data
to only include rows where:
revenue
is greater thantarget
AND
women
is greater thanmen
Save your answer to the variable results
, and view it.