twolodzko / kernelboot
Showing 1 of 1 files from the diff.

@@ -312,14 +312,14 @@
Loading
312 312
  }
313 313
314 314
  if (is.character(bw)) {
315 +
    method <- bw
315 316
    if (is.data.frame(data) || is.matrix(data)) {
316 -
      method <- bw
317 317
      bw <- matrix(0, m, m)
318 318
      if (!is.null(colnames(data)))
319 319
        rownames(bw) <- colnames(bw) <- colnames(data)
320 -
      bw[incl_cols, incl_cols] <- calculate_bandwidth(data[, incl_cols], method, kernel)
320 +
      bw[incl_cols, incl_cols] <- calculate_bandwidth(data[, incl_cols], method, kernel == 'multivariate')
321 321
    } else {
322 -
      bw <- calculate_bandwidth(data, bw, kernel)
322 +
      bw <- calculate_bandwidth(data, method, FALSE)
323 323
    }
324 324
  }
325 325
@@ -556,18 +556,18 @@
Loading
556 556
}
557 557
558 558
559 -
calculate_bandwidth <- function(data, bw, kernel) {
560 -
  bw <- tolower(bw)
561 -
  if (bw == "default") {
559 +
calculate_bandwidth <- function(data, method, multivariate) {
560 +
  method <- tolower(method)
561 +
  if (method == "default") {
562 562
    if (is.simple.vector(data)) {
563 563
      bw <- bw.nrd0(data)
564 564
    } else {
565 565
      bw <- bw.silv(data)
566 -
      if (kernel != "multivariate")
566 +
      if (!multivariate)
567 567
        bw <- sqrt(diag(bw))
568 568
    }
569 569
  } else {
570 -
    bw <- switch(bw, nrd0 = bw.nrd0(data), nrd = bw.nrd(data),
570 +
    bw <- switch(method, nrd0 = bw.nrd0(data), nrd = bw.nrd(data),
571 571
                 ucv = bw.ucv(data), bcv = bw.bcv(data), sj = ,
572 572
                 `sj-ste` = bw.SJ(data, method = "ste"),
573 573
                 `sj-dpi` = bw.SJ(data, method = "dpi"),
Files Coverage
R 90.16%
src 96.95%
Project Totals (12 files) 92.82%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading