From 9f0cb5f3da5a0e4f3dbe7c8d287cd9875a372800 Mon Sep 17 00:00:00 2001 From: hardin47 Date: Sun, 29 Sep 2024 09:38:33 -0700 Subject: [PATCH] removing the zero yield crop countries from the plot in chp 7 --- model-slr.qmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model-slr.qmd b/model-slr.qmd index c5d65afa..a016404b 100644 --- a/model-slr.qmd +++ b/model-slr.qmd @@ -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. @@ -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),