wch / webshot

Take screenshots of web pages from R
http://wch.github.io/webshot/
227 stars 40 forks source link

webshot generates warning message if v #116

Open warnes opened 1 year ago

warnes commented 1 year ago

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: https://github.com/wch/webshot/blob/e5df3d03bb1fd715b5841216357ed7ec37b39560/R/webshot.R#L191-L204

A simple solution would be to check for cliprect=="viewport" earlier in the function.