Skip to content

Commit df05c6a

Browse files
committed
minor fix
1 parent bdb53c9 commit df05c6a

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

what-is-tidier-jl.jl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,6 @@ No. The `meds_clean` data frame only captures patients who are taking at least o
337337
To evaluate this, let's join the `patients_clean` data frame with `meds_clean_count` and examine the `num_meds` column. If all patients in the `patients_clean` data frame are also represented in the `meds_clean_count` data frame, then there should be no missing values for `num_meds`.
338338
"""
339339

340-
# ╔═╡ 597f559a-abd5-4ceb-b23f-1e32b7e5e78b
341-
@chain begin
342-
@left_join(patients_clean, meds_clean_count)
343-
@count(num_meds)
344-
end
345-
346340
# ╔═╡ 4cb280c9-0f4b-4173-8858-6c1253496d6a
347341
md"""
348342
While most patients in this dataset are taking at least one medication, `348` patients have a `missing` value for `num_meds` after joining the two datasets, which means that they are not on medications.
@@ -358,25 +352,15 @@ We will add a `@count(num_meds)` at the end of the chain to confirm that the `mi
358352
In previous code, we have always started a chain with the syntax `@chain df begin`, where `df` represents a data frame. You can alternatively begin a chain with `@chain begin`, which is especially handy when the initial value is lengthy to type, such as when starting a chain with a `@left_join`.
359353
"""
360354

361-
# ╔═╡ 6ea5a632-0c97-4a8d-90ea-7add7dc99304
362-
@chain begin
363-
@left_join(patients_clean, meds_clean_count)
364-
@mutate(num_meds = replace_missing(num_meds, 0))
365-
@count(num_meds)
366-
end
367-
368355
# ╔═╡ f62652d2-43f9-4728-8ff1-856bc26a530e
369356
md"""
370357
The 348 `missing` values are now zeros, so let's recalculate the average.
371358
"""
372359

373-
# ╔═╡ 6f1d3c1f-6c77-4474-a69f-bb663c27b6cc
360+
# ╔═╡ 597f559a-abd5-4ceb-b23f-1e32b7e5e78b
374361
@chain begin
375362
@left_join(patients_clean, meds_clean_count)
376-
@mutate(num_meds = replace_missing(num_meds, 0))
377-
@summarize(mean_num_meds = mean(num_meds),
378-
min_num_meds = minimum(num_meds),
379-
max_num_meds = maximum(num_meds))
363+
@count(num_meds)
380364
end
381365

382366
# ╔═╡ 773fba31-b9ad-4db6-a70b-55fc7dd18372
@@ -447,6 +431,22 @@ If you've been carefully looking through the code, following along, and everythi
447431
The next section on reading data will cover the details, starting with how to read in a data frame from a file.
448432
"""
449433

434+
# ╔═╡ 6ea5a632-0c97-4a8d-90ea-7add7dc99304
435+
@chain begin
436+
@left_join(patients_clean, meds_clean_count)
437+
@mutate(num_meds = replace_missing(num_meds, 0))
438+
@count(num_meds)
439+
end
440+
441+
# ╔═╡ 6f1d3c1f-6c77-4474-a69f-bb663c27b6cc
442+
@chain begin
443+
@left_join(patients_clean, meds_clean_count)
444+
@mutate(num_meds = replace_missing(num_meds, 0))
445+
@summarize(mean_num_meds = mean(num_meds),
446+
min_num_meds = minimum(num_meds),
447+
max_num_meds = maximum(num_meds))
448+
end
449+
450450
# ╔═╡ 00000000-0000-0000-0000-000000000001
451451
PLUTO_PROJECT_TOML_CONTENTS = """
452452
[deps]
@@ -3063,7 +3063,7 @@ version = "3.6.0+0"
30633063
"""
30643064

30653065
# ╔═╡ Cell order:
3066-
# ╠═daf77ffe-a06d-489b-9fff-ce84d377c86f
3066+
# ╟─daf77ffe-a06d-489b-9fff-ce84d377c86f
30673067
# ╟─34de12cb-2e15-4f12-93e0-0a897ce5fa9c
30683068
# ╟─9d465a8f-a418-4fe6-bebc-7f9c7aa632cf
30693069
# ╟─2b49dad8-a00c-46f2-8c19-617292584e2c

0 commit comments

Comments
 (0)