Skip to content

Commit

Permalink
Merge pull request #36 from ibecav/v0.6.3
Browse files Browse the repository at this point in the history
V0.6.3 Github stable
  • Loading branch information
ibecav committed Jul 31, 2020
2 parents 030fd94 + 9b1c410 commit f01c4a8
Show file tree
Hide file tree
Showing 22 changed files with 100 additions and 21 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ importFrom(stats,symnum)
importFrom(stringr,str_replace_all)
importFrom(stringr,str_split)
importFrom(stringr,str_trim)
importFrom(tidyr,complete)
importFrom(tidyr,drop_na)
importFrom(tidyr,pivot_wider)
importFrom(tidyr,separate)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
* Release 0.6.3 in development July 2020 CRAN submission ????
- Eliminated dependency on car package and broom package. Great packages but I only need a couple of functions and they have a lot of dependencies
- tibble 3.0.2 introduces a silly warning about dots fixed in 3.0.3
- Added a short Bayesian analysis of the model
- Better checking for cell counts of zero or less than 3
- Now possible to plot without errorbars
- Updated title to be more informative

* Release 0.6.2 in development July 2020 CRAN submission July 16
- Planned enhancements to Plot2WayANOVA
Expand Down
39 changes: 33 additions & 6 deletions R/Plot2WayANOVA.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#' @param errorbar.display default "CI" (confidence interval), which type of
#' errorbar should be displayed around the mean point? Other options
#' include "SEM" (standard error of the mean) and "SD" (standard dev).
#' "none" removes it entirely much like \code{\link[stats]{interaction.plot}}
#' @param PlotSave a logical indicating whether the user wants to save the plot
#' as a png file
#' @param xlab,ylab Labels for `x` and `y` axis variables. If `NULL` (default),
Expand Down Expand Up @@ -133,7 +134,7 @@
#' @author Chuck Powell
#' @seealso \code{\link[stats]{aov}}, \code{\link{BrownForsytheTest}},
#' \code{sjstats::anova_stats}, \code{\link[stats]{replications}},
#' \code{\link[stats]{shapiro.test}}
#' \code{\link[stats]{shapiro.test}}, \code{\link[stats]{interaction.plot}}
#' @examples
#'
#' Plot2WayANOVA(mpg ~ am * cyl, mtcars, plottype = "line")
Expand All @@ -158,6 +159,7 @@
#' @importFrom sjstats anova_stats
#' @importFrom DescTools PostHocTest
#' @importFrom BayesFactor anovaBF
#' @importFrom tidyr complete
#' @export
#'
Plot2WayANOVA <- function(formula,
Expand Down Expand Up @@ -305,7 +307,30 @@ Plot2WayANOVA <- function(formula,
warning(paste(sum(missing)), " case(s) removed because of missing data")
}
dataframe <- dataframe[!missing, ]


# -------- Check cell counts ----------------

checkcells <-
dataframe %>%
group_by(!!sym(iv1), !!sym(iv2)) %>%
summarize(count = n()) %>%
ungroup() %>%
complete(!!sym(iv1), !!sym(iv2), fill = list(count = 0))

if (any(checkcells$count == 0)) {
print(checkcells)
stop(paste0(
"\n--- MAJOR Problem! ---\n",
"You have one or more cells with ZERO observations.\n"
))
} else if (any(checkcells$count <= 2)){
message(paste0(
"\n\t\t\t\t--- WARNING! ---\n",
"\t\tYou have one or more cells with less than 3 observations.\n"
))
print(checkcells)
}

# -------- Build summary dataframe ----------------

newdata <- dataframe %>%
Expand Down Expand Up @@ -627,8 +652,8 @@ Plot2WayANOVA <- function(formula,
}

# -------- Warn user of unbalanced design ----------------

if (is.list(replications(formula, dataframe))) {
if (!all(checkcells$count == checkcells$count[1])) {
rsquaredx <- round(1 - (MyAOVt2$`Sum Sq`[4] / sum(MyAOVt2$`Sum Sq`[1:4])), 3)
message(paste0(
"\n\t\t\t\t--- WARNING! ---\n",
Expand All @@ -641,6 +666,8 @@ Plot2WayANOVA <- function(formula,
else {
message("\nYou have a balanced design. \n")
}

# return(checkcells)
print(WithETA)

# -------- Print tests and tables ----------------
Expand All @@ -667,10 +694,10 @@ Plot2WayANOVA <- function(formula,
message("\nBayesian analysis of models in order\n")
print(bf_models)

### ----- adding optional ggplot.component ----------
# -------- adding optional ggplot.component ----------
p <- p + ggplot.component

#### -------- Print the plot itself ----------------
# -------- Print the plot itself ----------------

message("\nInteraction graph plotted...")
print(p)
Expand Down
31 changes: 26 additions & 5 deletions docs/articles/Using-Plot2WayANOVA.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Using-PlotXTabs.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Using-PlotXTabs2.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/articles/Using-PlotXTabs2_files/figure-html/simple-1.png
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/articles/Using-PlotXTabs2_files/figure-html/simple2-1.png
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 docs/articles/Using-chaid_table.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Using-newggslopegraph.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ articles:
Using-PlotXTabs2: Using-PlotXTabs2.html
Using-chaid_table: Using-chaid_table.html
Using-newggslopegraph: Using-newggslopegraph.html
last_built: 2020-07-30T20:01Z
last_built: 2020-07-31T18:35Z
urls:
reference: http://ibecav.github.io/CGPfunctions/reference
article: http://ibecav.github.io/CGPfunctions/articles
Expand Down
27 changes: 24 additions & 3 deletions docs/reference/Plot2WayANOVA.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/Plot2WayANOVA.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f01c4a8

Please sign in to comment.