Showing 1 of 2 files from the diff.
Other files ignored by Codecov

@@ -35,6 +35,7 @@
Loading
35 35
#' scaling color space matching the color vision of the human visual
36 36
#' system. The name is matched to the list of available color palettes from
37 37
#' the \code{hcl.colors} function in the \code{grDevices} package.
38 +
#' @param col vector of colors of length equal to the number of phyloregions.
38 39
#' @param shp a polygon shapefile of grid cells.
39 40
#' @param \dots arguments passed among methods.
40 41
#' @return No return value, called for plotting.
@@ -45,15 +46,22 @@
Loading
45 46
#' @importFrom graphics plot plot.default
46 47
#' @rawNamespace export(plot.phyloregion)
47 48
#' @export
48 -
plot.phyloregion <- function(x, shp=NULL, palette="NMDS", ...) {
49 +
plot.phyloregion <- function(x, shp=NULL, palette="NMDS", col=NULL, ...) {
49 50
  if (!inherits(x, "phyloregion"))
50 51
    stop("object \"x\" is not of class \"phyloregion\"")
51 52
  if(is.null(shp)) shp <- x$shp
52 53
  if(is.null(shp)) stop("Need shape file!")
53 54
  k <- x$k
54 -
  if(palette=="NMDS") clr <- shp$COLOURS
55 -
    else clr <- hcl.colors(k, palette)[shp$cluster]
56 -
  plot(shp, col = clr, ...)
55 +
  #l <- length(shp$cluster)
56 +
  if(is.null(col)){
57 +
    if(palette=="NMDS") col <- shp$COLOURS
58 +
    else col <- hcl.colors(k, palette)[shp$cluster]
59 +
  }
60 +
  else{
61 +
    if(length(col)==k) col <- col[shp$cluster]
62 +
    else stop("Expect 'col' of length x$k!")
63 +
  }
64 +
  plot(shp, col = col, ...)
57 65
  text(shp, labels = as.character(shp@data$cluster), ...)
58 66
}
59 67
Files Coverage
R 7.87%
Project Totals (37 files) 7.87%
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