Skip to content

Commit

Permalink
r
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Feb 1, 2025
1 parent e9a8ff9 commit f4477b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions R/plot_let.R
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ make.panel <- function(x, maxcell) {
if (inherits(cols, "function")) {
cols <- cols(ncols)
} else {
cols <- colorRampPalette(cols)(ncols)
cols <- grDevices::colorRampPalette(cols)(ncols)
}
return(list(type=type, x=x, cols=cols))

Expand Down Expand Up @@ -616,7 +616,7 @@ setMethod("plet", signature(x="SpatRaster"),
RGB(x) <- 1:length(y)
x <- colorize(x, "col")
} else {
leg <- .get_cls(x, type=type, dig.lab=3, cols=col, breaks=breaks, breakby=breakby, sort=sort, decreasing=decreasing, ...)
leg <- .get_cls(x, type=type, dig.lab=3, cols=col, breaks=breaks, breakby=breakby, ...)
x <- leg$x
col <- leg$cols
}
Expand All @@ -634,7 +634,6 @@ setMethod("plet", signature(x="SpatRaster"),
} else {
map <- leaflet::addLegend(map, position=legend, colors=leg$cols,
labels=levels(x)[[1]][,2], opacity=alpha, title=main)

}
}
if (panel) {
Expand Down
2 changes: 1 addition & 1 deletion man/divide.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Divides a \code{SpatVector} of polygons into \code{n} compact and approximately
\item{...}{additional arguments such as \code{iter.max} passed on to \code{\link{kmeans}}}
}

\seealso{\code{\link{twoClasses}}}
\seealso{\code{\link{thresh}}}

\value{SpatVector or SpatRaster, or a list with both}

Expand Down

0 comments on commit f4477b6

Please sign in to comment.