Skip to content

Commit

Permalink
423
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Mar 28, 2024
1 parent 5d4d1fd commit b317b9e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 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.422
Version: 0.5.423
Authors@R:
person(given = "Jin",
family = "Kim",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# kim 0.5.423
* Updated the following function(s) (and other functions that use them):
floodlight_2_by_continuous, scatterplot

# kim 0.5.422
* Updated the following function(s) (and other functions that use them):
scatterplot, loglinear_analysis, plot_group_means, two_way_anova,
Expand Down
7 changes: 5 additions & 2 deletions R/floodlight_2_by_continuous.R
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ floodlight_2_by_continuous <- function(
}
# add jitter if any pair of dots overlap
dt[, mod_dv_concatenated := paste0(mod, dv)]
if (any(duplicated(dt[, mod_dv_concatenated]))) {
if (any(duplicated(dt[, mod_dv_concatenated])) &
jitter_x_y_percent == 0) {
jitter_x_y_percent <- 2
kim::pm(
"Because at least one pair of dots overlapped, ",
Expand All @@ -381,8 +382,10 @@ floodlight_2_by_continuous <- function(
" (of the observed range).")
}
# add jitter
if (jitter_x_y_percent > 0) {
if (jitter_x_percent == 0 & jitter_x_y_percent > 0) {
jitter_x_percent <- jitter_x_y_percent
}
if (jitter_y_percent == 0 & jitter_x_y_percent > 0) {
jitter_y_percent <- jitter_x_y_percent
}
g1 <- g1 + ggplot2::geom_point(
Expand Down
7 changes: 5 additions & 2 deletions R/scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ scatterplot <- function(
}
# add jitter and set alpha if any pair of dots overlap
dt02[, x_y_concatenated := paste0(x, y)]
if (any(duplicated(dt02[, x_y_concatenated]))) {
if (any(duplicated(dt02[, x_y_concatenated])) &
jitter_x_y_percent == 0) {
jitter_x_y_percent <- 2
alpha <- 0.4
kim::pm(
Expand All @@ -226,8 +227,10 @@ scatterplot <- function(
alpha, ").")
}
# add jitter
if (jitter_x_y_percent > 0) {
if (jitter_x_percent == 0 & jitter_x_y_percent > 0) {
jitter_x_percent <- jitter_x_y_percent
}
if (jitter_y_percent == 0 & jitter_x_y_percent > 0) {
jitter_y_percent <- jitter_x_y_percent
}
if (jitter_x_percent > 0 | jitter_y_percent > 0) {
Expand Down
4 changes: 2 additions & 2 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ bibentry(
title = "kim: A Toolkit for Behavioral Scientists",
author = "Jin Kim",
year = "2024",
note = "R package version 0.5.422",
note = "R package version 0.5.423",
howpublished = "url{https://jinkim.science/docs/kim.pdf}",
url = "https://cran.r-project.org/package=kim",
textVersion = paste0(
"Jin Kim (2024). ",
"kim: A Toolkit for Behavioral Scientists. ",
"R package version 0.5.422"
"R package version 0.5.423"
)
)

0 comments on commit b317b9e

Please sign in to comment.