Skip to content

Commit

Permalink
fix (viz): tweaked script making source data for one of the code demo…
Browse files Browse the repository at this point in the history
… bits to ensure the demo error was truly present
  • Loading branch information
njlyon0 committed Nov 13, 2024
1 parent bc75de1 commit b0ddd67
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions _freeze/mod_data-viz/execute-results/html.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/mod_data-viz/figure-html/multi-modal-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mod_data-viz.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ Some other factors you might consider _regardless of where the graphs will be em

After harmonizing your data, you'll want to generate one last set of 'sanity check' plots to make sure (1) you have interpreted the metadata correctly (2) you haven't made any obvious errors in the harmonization and (3) your data are ready for analysis. Nothing is less fun than finding out your analytical results are due to an error in the underlying data.

For these plots, printing out to multi-page PDFs can be helpful instead of trying to scroll through many pages on the screen.
The following is a multi-part code demonstration of three common post-harmonization uses of visualization. In addition to being useful graphs, there is also example code on how to export multiple panels of graphs into separate pages of a PDF which can be really helpful when reviewing exploratory visualizations as a group (without needing to scroll through a ton of separate graph files).

### Additional Needed Packages

Expand Down
4 changes: 2 additions & 2 deletions scripts/prep-data_data-viz-demo.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ datafile <- tidyr::expand_grid(
dplyr::mutate(count = random_walk(n = length(year), start = 10, sd = 3)) %>%
dplyr::ungroup() %>%
# make pseudoturnover
dplyr::mutate(taxon = ifelse(test = (taxon == "Taxon_1" & year == 2014),
yes = "Taxon_2", no = taxon)) %>%
dplyr::mutate(taxon = ifelse(test = (taxon == "Taxon_A" & year == 2014),
yes = "Taxon_B", no = taxon)) %>%
# Change into a typical "presence only" survey
dplyr::filter(count != 0)

Expand Down

0 comments on commit b0ddd67

Please sign in to comment.