Skip to content

Problem with extendLimits test #345

@simonbrewer

Description

@simonbrewer

I ran into a problem with using mapview and specifying a variable for the col argument. For example:

library(mapview)
franconia$n <- rnorm(nrow(franconia))
mapview(franconia, zcol = "n")

Error in if (all.equal(lim[1], lim[2])) lim = lim * c(0.999, 1.001) : 
  argument is not interpretable as logical

I think the issue stems from the use of all.equal to test the range limits in the extendLimits function. This can't be used directly with if. I think this would work instead:

if (isTRUE(all.equal(lim[1], lim[2]))) lim = lim * c(0.999, 1.001)

For example

lim <- c(2, 2)
if (isTRUE(all.equal(lim[1], lim[2]))) lim = lim * c(0.999, 1.001)
print(lim)

[1] 1.998 2.002

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions