Skip to content

Commit

Permalink
Removing tabset panels
Browse files Browse the repository at this point in the history
  • Loading branch information
njlyon0 committed Feb 7, 2024
1 parent 47acfa9 commit 088ea58
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions mod_reproducibility.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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. **


Expand Down

0 comments on commit 088ea58

Please sign in to comment.