Skip to content

Commit

Permalink
fix check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
huizezhang-sherry committed Jun 11, 2024
1 parent 807812c commit 2212dab
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Imports:
ggplot2,
tibble,
purrr,
geozoo,
tourr,
stringr,
ggrepel,
Expand Down
3 changes: 2 additions & 1 deletion R/draw.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ add_interp <- function(dt, interp_size = 1.5, interp_alpha = NULL,
#' @family draw functions
#' @export
add_interrupt <- function(dt, interrupt_size = 0.5, interrupt_alpha = NULL,
interrupt_color = NULL, interrupt_group = NULL, interrupt_linetype = "dashed", ...) {
interrupt_color = NULL, interrupt_group = NULL,
interrupt_linetype = "dashed", ...) {
ggplot2::geom_path(
data = dt,
ggplot2::aes(
Expand Down
11 changes: 6 additions & 5 deletions R/explore-space-pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ explore_space_end <- function(dt, group = NULL, pca = TRUE, ...) {
#' @export
explore_space_pca <- function(dt, details = FALSE, pca = TRUE, group = NULL,
color = NULL, facet = NULL, ..., animate = FALSE) {

if (rlang::quo_is_null(dplyr::enquo(color))) color <- dplyr::enexpr(group)

facet <- rlang::enquo(facet)
if (!rlang::quo_is_missing(facet)) group <- facet
if (rlang::quo_is_missing(facet)) group <- facet else group <- dplyr::enexpr(group)

if (pca) dt <- compute_pca(dt, group = {{ group }}, ...) %>% purrr::pluck("aug")

Expand All @@ -95,12 +94,14 @@ explore_space_pca <- function(dt, details = FALSE, pca = TRUE, group = NULL,
# anchor points and last interpolation points
p <- p +
add_anchor(dt = get_anchor(dt), anchor_color = {{ color }}, ...) +
add_interp_last(dt = get_interp_last(dt, group = {{ group }}), interp_last_color = {{ color }}, ...) +
add_interp_last(dt = get_interp_last(dt, group = {{ group }}),
interp_last_color = {{ color }}, ...) +
# add annotation
add_interrupt(
dt = get_interrupt(dt, group = {{ group }}),
interrupt_color = {{ color }}, interrupt_group = interaction(.data[["tries"]], {{ group }}), ...
)
interrupt_color = {{ color }},
interrupt_group = interaction(.data[["tries"]], {{group}}),
...)

# search points
p <- p +
Expand Down
3 changes: 1 addition & 2 deletions R/get.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ get_best <- function(dt, group = NULL) {
}

res <- dt %>%
dplyr::filter(grepl("search", dt[["method"]])) %>%
dplyr::group_by({{group}}) %>%
dplyr::filter(.data$index_val == max(.data$index_val, na.rm = TRUE)) %>%
dplyr::distinct(.data$index_val, .keep_all = TRUE)
Expand Down Expand Up @@ -108,7 +107,7 @@ get_interp <- function(dt, group = NULL) {
}

dt %>%
dplyr::filter(grepl("search", dt[["method"]])) %>%
#dplyr::filter(grepl("search", dt[["method"]])) %>%
dplyr::group_by({{ group }}) %>%
dplyr::mutate(id = dplyr::row_number()) %>%
dplyr::ungroup()
Expand Down
4 changes: 2 additions & 2 deletions R/plot-projection.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ plot_projection <- function(dt, data, cols = NULL){
d <- ncol(proj_df) - 1 - length(cols)

if (d == 2){
p <- proj_df |>
p <- proj_df |>
ggplot2::ggplot() +
ggplot2::geom_point(ggplot2::aes(x = V1, y = V2))
ggplot2::geom_point(ggplot2::aes(x = V1, y = V2), size = 0.5)
} else if (d == 1) {
p <- proj_df |>
ggplot2::ggplot() +
Expand Down
2 changes: 1 addition & 1 deletion man/data.Rd

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

0 comments on commit 2212dab

Please sign in to comment.