Skip to content

Commit

Permalink
fix associated tests and build data structure
Browse files Browse the repository at this point in the history
  • Loading branch information
munoztd0 committed Jul 28, 2023
1 parent 4140a34 commit 2b44658
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ globalVariables(c("x", "e", ".", "acc", "epoch", "loss", "size", "val_acc", "val

.build_data2 <- function(data, ...) {
row.names(data) <- NULL
data <- data |>
dplyr::select(...)
# data <- data[, c(...), drop = FALSE]
# data <- data |>
# dplyr::select(...)
data <- data[, c(...), drop = FALSE]
data <- unname(data)

apply(data, 1, function(x) {
Expand Down
15 changes: 8 additions & 7 deletions tests/testthat/test-chart_types.R
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,14 @@ test_that("e_candle plot has the good data structure and type", {
expect_equal(
plot$x$opts$series[[1]]$data,
list(
list(value = c(200.72, 200.60, 197.82, 203.32)),
list(value = c(198.85, 200.22, 198.07, 200.67)),
list(value = c(199.05, 198.43, 197.90, 200.00)),
list(value = c(203.73, 199.05, 198.10, 203.95)),
list(value = c(204.08, 203.54, 202.00, 204.90)),
list(value = c(208.11, 203.40, 201.50, 208.44)),
list(value = c(211.88, 208.34, 207.60, 213.17)))
list(value = c(200.60, 200.72, 197.82, 203.32)),
list(value = c(200.22, 198.85, 198.07, 200.67)),
list(value = c(198.43, 199.05, 197.90, 200.00)),
list(value = c(199.05, 203.73, 198.10, 203.95)),
list(value = c(203.54, 204.08, 202.00, 204.90)),
list(value = c(203.40, 208.11, 201.50, 208.44)),
list(value = c(208.34, 211.88, 207.60, 213.17))
)
)
expect_equal(
plot$x$opts$series[[1]]$type,
Expand Down

0 comments on commit 2b44658

Please sign in to comment.