Skip to content

Commit

Permalink
removing the zero yield crop countries from the plot in chp 7
Browse files Browse the repository at this point in the history
  • Loading branch information
hardin47 committed Sep 29, 2024
1 parent 92e728f commit 9f0cb5f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions model-slr.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ Once you create a curve for each, describe what is important in your fit.[^07-mo
The plot below displays the relationships between various crop yields in countries.
In the plots, each point represents a different country.
The x and y variables represent the proportion of total yield in the last 50 years which is due to that crop type.
If a country did not produce a particular crop, it has been removed from the plot (so different plots may have different numbers of dots, each corresponding to one country).

Order the six scatterplots from strongest negative to strongest positive linear relationship.

Expand All @@ -720,6 +721,7 @@ crops_country <- crops_country |>
summarise(total = sum(yield, na.rm = TRUE), .groups = "drop_last") |>
mutate(prop = (total / sum(total)) * 100) |>
ungroup() |>
filter(prop > 0) |>
pivot_wider(
names_from = crop,
values_from = c(total, prop),
Expand Down

0 comments on commit 9f0cb5f

Please sign in to comment.