From 3c5b941b328ea25c1908f40409f7773aa17305d7 Mon Sep 17 00:00:00 2001 From: Xochitl Ortiz-Ross Date: Wed, 6 Nov 2024 12:10:10 -0800 Subject: [PATCH] Update 4-minimal-reproducible-data.Rmd --- episodes/4-minimal-reproducible-data.Rmd | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/episodes/4-minimal-reproducible-data.Rmd b/episodes/4-minimal-reproducible-data.Rmd index 369bbf78..ffd1faca 100644 --- a/episodes/4-minimal-reproducible-data.Rmd +++ b/episodes/4-minimal-reproducible-data.Rmd @@ -66,6 +66,7 @@ It would be a lot easier for the IT support person to fix your computer if they ::: instructor You can use the next example as well if you choose. ::: + ::: solution ## Another example: You're knitting a sweater and one of the sleeves looks wonky. You call a friend and ask why it's messed up. They can't possibly help without being able to hold the sweater and look at the stitches themselves. @@ -126,11 +127,9 @@ c(xm, mean(x, trim = 0.10)) ``` In this case, x is the dummy dataset consisting of just 1 variable. Notice how it was created as part of the example. - ::: :::: challenge - ### Exercise 1 These datasets are not well suited for use in a reprex. @@ -185,6 +184,7 @@ B) does not produce the same problem (NA result with a warning message)--the co D) is not reproducible. Sample randomly samples 10 items; sometimes it may include NAs, sometime it may not (not guaranteed to reproduce the error). It can be used if a seed is set (see next section for more info). E) uses a dataset that isn't accessible without previous data wrangling codeā€“the object rodents_modified doesn't exist. ::: +:::: ## 4.3 How do I create a minimal reproducible dataset? @@ -295,6 +295,7 @@ Try to answer the following questions oon your own and see if you can determine 1. To reproduce the figure, we can use 2-4 levels for one factors (species), and maybe 2 levels for the other factor (plot type) to keep it minimal. Our continuous variable could range 1 to 10 (date). We don't need too many observations, but we do have 2 categories, one with 4 levels. Let's make it an even 100. 1. NAs are not relevant to our problem ::: +:::: ::: instructor Maybe we don't need to include the solution and we just walk through it in the following section. @@ -578,6 +579,7 @@ How might you reproduce this using the mpg dataset? xlab("Class") ``` ::: +:::: ## 4.4 Using your own data by creating a minimal subset @@ -640,6 +642,7 @@ D) sample_data <- ____ C) **?? + what's really the point of this one?** D) `sample_data <- data.frame(x = factor(1:3), y = 4:6)` ::: +:::: ::: keypoints