Skip to content
Back to formatted view

Raw Message

Message-ID: <d7af87bb-569d-bf71-42bc-3afec1693ab5@gmail.com>
Date: 2019-07-25T19:38:31Z
From: Duncan Murdoch
Subject: [R-pkg-devel] Needing rgeos from sf
In-Reply-To: <016B78F5-EFED-4DC9-BED2-031D55C8656C@noaa.gov>

On 25/07/2019 3:21 p.m., Roy Mendelssohn - NOAA Federal via 
R-package-devel wrote:
> I have been testing a package for resubmission with bug fixes.  On the present CRAN builds I get:
> 
>> Result: NOTE
>>      Namespaces in Imports field not imported from:
>>       ?mapdata? ?maptools? ?plot3D? ?rgdal? ?rgeos?
>>       All declared Imports should be used.
> 
> However,  if I remove rgeos from the imports I get from win builder:
> 
>> Error in st_as_sfc.SpatialPolygons(sp::geometry(x), ...) :
>>       package rgeos required for finding out which hole belongs to which exterior ring
> 
> Note that I am not calling 'rgeos',  either 'sf' or 'sp' is,  but does not appear to be properly importing all the need namespaces.
> 
> Best way  to proceed?  Include rgeos in Import and get the Note,  or ????

A simple workaround would be to add a function that calls something from 
rgeos just to satisfy the check, e.g.

# Just to satisfy the checks...
dummy <- function() rgeos::getScale()

I don't think there are warnings if dummy is never used or exported, but 
if there are, I think that's a pretty harmless call to make.

Duncan Murdoch