When webshot is called with the cliprect parameter set to "viewport" it generates the warning message:
Warning: 'length(x) = 4 > 1' in coercion to 'logical(1)'.
Example
webshot::webshot("http://r-project.org", cliprect = "viewport")
This appears to be generated from these lines in mapshot:
|
cliprect <- lapply(cliprect, function(x) { |
|
if (is.character(x)) { |
|
if (x == "viewport") { |
|
x <- c(0, 0, vwidth, vheight) |
|
} else { |
|
stop("Invalid value for cliprect: ", x) |
|
} |
|
} else { |
|
if (!is.numeric(x) || length(x) != 4) { |
|
stop("'cliprect' must be a 4-element numeric vector or a list of such vectors") |
|
} |
|
} |
|
x |
|
}) |
A simple solution would be to check for cliprect=="viewport" earlier in the function.
When
webshotis called with thecliprectparameter set to "viewport" it generates the warning message:Warning: 'length(x) = 4 > 1' in coercion to 'logical(1)'.Example
This appears to be generated from these lines in
mapshot:webshot/R/webshot.R
Lines 191 to 204 in e5df3d0
A simple solution would be to check for
cliprect=="viewport"earlier in the function.