From 088ea58a29bf4ed04133ad14c19abc2907ee671a Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Wed, 7 Feb 2024 15:03:59 -0500 Subject: [PATCH] Removing tabset panels --- mod_reproducibility.qmd | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/mod_reproducibility.qmd b/mod_reproducibility.qmd index 50284b4..30ff5c5 100644 --- a/mod_reproducibility.qmd +++ b/mod_reproducibility.qmd @@ -124,40 +124,6 @@ It can be difficult to balance these two imperatives but short object names are Scripts are free to write regardless of the number of lines so do not feel as though there is a strict character limit you need to keep in mind. Cramped code is difficult to read and thus can be challenging to share with others or debug on your own. Inserting an empty line between coding lines can help break up sections of code and putting spaces before and after operators can make reading single lines much simpler. -:::panel-tabset - -## Cramped Code - -Note that I've removed the comments from this example but even cramped code should still have comments! More on that shortly. - -```{.r} -proportion_traps<-seeds_v1%>% - dplyr::filter(General.method=="TRAP")%>% - dplyr::filter(Count>0)%>% - dplyr::group_by(LTER.Site,Plot.ID,Species.Name)%>% - dplyr::summarise(n.traps.species=length(unique(Trap.ID)))%>% - dplyr::ungroup()%>% - dplyr::left_join(y=traps_plot_max,by=c("LTER.Site","Plot.ID"))%>% - dplyr::mutate(prop.traps=n.traps.species/max.traps) -``` - -## Spacious Code - -Even without comments, see how much more readable this code is? - -```{.r} -proportion_traps <- seeds_v1 %>% - dplyr::filter(General.method == "TRAP") %>% - dplyr::filter(Count > 0) %>% - dplyr::group_by(LTER.Site, Plot.ID, Species.Name) %>% - dplyr::summarise(n.traps.species = length(unique(Trap.ID))) %>% - dplyr::ungroup() %>% - dplyr::left_join(y = traps_plot_max, by = c("LTER.Site", "Plot.ID")) %>% - dplyr::mutate(prop.traps = n.traps.species / max.traps) -``` - -::: - **3. **