Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Mar 28, 2024
1 parent b317b9e commit 963dd82
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: kim
Title: A Toolkit for Behavioral Scientists
Version: 0.5.423
Version: 0.5.424
Authors@R:
person(given = "Jin",
family = "Kim",
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# kim 0.5.423
* Updated the following function(s) (and other functions that use them):
floodlight_2_by_continuous, scatterplot
floodlight_2_by_continuous, scatterplot, install_all_dependencies

# kim 0.5.422
* Updated the following function(s) (and other functions that use them):
Expand Down
29 changes: 17 additions & 12 deletions R/floodlight_2_by_continuous_for_logistic.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
#' @param dot_size size of the dots (default = 6)
#' @param interaction_p_value_font_size font size for the interaction
#' p value (default = 8)
#' @param jn_point_label_add logical. Should the labels for
#' Johnson-Neyman point labels be added to the plot? (default = TRUE)
#' @param jn_point_font_size font size for Johnson-Neyman point labels
#' (default = 8)
#' @param jn_point_label_hjust a vector of hjust values for
Expand Down Expand Up @@ -132,6 +134,7 @@ floodlight_2_by_continuous_logistic <- function(
dot_alpha = 0.3,
dot_size = 6,
interaction_p_value_font_size = 8,
jn_point_label_add = TRUE,
jn_point_font_size = 8,
jn_point_label_hjust = NULL,
interaction_p_vjust = -3,
Expand Down Expand Up @@ -709,19 +712,21 @@ floodlight_2_by_continuous_logistic <- function(
yend = dv_max_observed,
color = "black",
linewidth = jn_line_thickness)
# label jn points
if (is.null(jn_point_label_hjust)) {
jn_point_label_hjust <- rep(0.5, num_of_jn_points)
if (jn_point_label_add == TRUE) {
# label jn points
if (is.null(jn_point_label_hjust)) {
jn_point_label_hjust <- rep(0.5, num_of_jn_points)
}
g1 <- g1 + ggplot2::annotate(
geom = "text",
x = jn_points_final[j],
y = Inf,
label = round(jn_points_final[j], round_jn_point_labels),
hjust = jn_point_label_hjust[j], vjust = -0.5,
fontface = "bold",
color = "black",
size = jn_point_font_size)
}
g1 <- g1 + ggplot2::annotate(
geom = "text",
x = jn_points_final[j],
y = Inf,
label = round(jn_points_final[j], round_jn_point_labels),
hjust = jn_point_label_hjust[j], vjust = -0.5,
fontface = "bold",
color = "black",
size = jn_point_font_size)
}
}
# x axis title
Expand Down
2 changes: 1 addition & 1 deletion R/install_all_dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
install_all_dependencies <- function() {
# packages and dependencies to install
pkgs <- c(
"boot", "car", "data.table", "effsize", "ggplot2",
"boot", "car", "data.table", "DEoptim", "effsize", "ggplot2",
"ggridges", "gridExtra", "interactions", "lemon", "lm.beta",
"mediation", "moments", "paran", "psych", "remotes", "svglite",
"weights", "WRS2", "MASS",
Expand Down
4 changes: 4 additions & 0 deletions man/floodlight_2_by_continuous_logistic.Rd

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

0 comments on commit 963dd82

Please sign in to comment.