Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Makefile; add na.rm = TRUE and is.finite to part 2 #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HTML_FILES := $(filter-out docs/_sessionInfo.html, $(HTML_FILES))
R_FILES := $(patsubst %.R, docs/%.html, $(wildcard Part*.R))

.PHONY: all
all : cleanjunk html
all : clean html

.PHONY : html
html : docs/index.html docs/data.html $(HTML_FILES) $(R_FILES)
Expand All @@ -23,11 +23,11 @@ docs/%.Rmd : %.R docs/knitopts.R
R --slave -e "rmarkdown::render_site('$<')"

.PHONY : clean
clean :
clean : cleanjunk
$(RM) $(R_FILES)
R --slave -e "rmarkdown::clean_site('docs')"

.PHONY : cleanjunk
cleanjunk :
cleanjunk :
$(RM) -r results/
$(RM) -r data/FungicideTidy.csv
9 changes: 7 additions & 2 deletions Part2-Fig2Recreation.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,14 @@ percents <- blocks %>%
percents
#' Because figure 2 plotted the average value, we want to summarize our data in
#' averages. To do this, we need to convert our data back to tidy format by
#' using the *tidyr* function `gather()`:
#' using the *tidyr* function `gather()`.
#'
#' Additionally, because we observed some values that were missing or divided by
#' zero, we need to add a filter that removes these points. For that, we will
#' use the function `is.finite()`.
percents <- percents %>%
gather(key = Treatment, value = Area, -DAI, -Block) %>%
filter(is.finite(Area)) %>% # selecting all the finite values of Area
mutate(Treatment = factor(Treatment, levels = unique(Treatment))) # reset factor
percents
#'
Expand All @@ -154,7 +159,7 @@ percents
#' to plot the data in the manner of Morini *et al.* 2017.
avgs <- percents %>%
group_by(DAI, Treatment) %>%
summarize(meanArea = mean(Area)) %>%
summarize(meanArea = mean(Area, na.rm = TRUE)) %>%
ungroup()
avgs
#'
Expand Down
777 changes: 0 additions & 777 deletions Part2-Fig2Recreation.html

This file was deleted.

178 changes: 0 additions & 178 deletions README.html

This file was deleted.

568 changes: 283 additions & 285 deletions docs/Part2-Fig2Recreation.html

Large diffs are not rendered by default.

Binary file modified docs/Part2-Fig2Recreation_files/figure-html/unnamed-chunk-12-1.png
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 docs/Part2-Fig2Recreation_files/figure-html/unnamed-chunk-13-1.png
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 docs/Part2-Fig2Recreation_files/figure-html/unnamed-chunk-14-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 0 additions & 30 deletions docs/site_libs/highlightjs-1.1/default.css

This file was deleted.

3 changes: 0 additions & 3 deletions docs/site_libs/highlightjs-1.1/highlight.js

This file was deleted.

29 changes: 0 additions & 29 deletions docs/site_libs/highlightjs-1.1/textmate.css

This file was deleted.