Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmap pkg should be escaped in examples #123

Closed
jangorecki opened this issue Sep 16, 2016 · 1 comment
Closed

tmap pkg should be escaped in examples #123

jangorecki opened this issue Sep 16, 2016 · 1 comment

Comments

@jangorecki
Copy link

Hi,
Just came to inform that suggested packages used in examples should be escaped, so not mandatory to run examples. Best way is to use if (requireNamespace(.)) {_actual_code_} function. Otherwise you should move tmap (and potentially others, tmap was first to fail) to imports.

* checking examples ... ERROR
Running examples in ‘stplanr-Ex.R’ failed
The error most likely occurred in:

> ### Name: line2points
> ### Title: Convert a SpatialLinesDataFrame to points
> ### Aliases: line2points line2pointsn
> 
> ### ** Examples
> 
> data(routes_fast)
> lpoints <- line2pointsn(routes_fast[2,]) # for a single line
> lpoints2 = line2points(routes_fast[2,])
> plot(lpoints)
> plot(lpoints2)
> lpoints = line2pointsn(routes_fast) # for many lines
> plot(lpoints)
> data(flowlines) # load demo flowlines dataset
> lpoints <- line2points(flowlines) # for many lines
Error in loadNamespace(name) : there is no package called ‘tmap’
Calls: line2points ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>

The best way to check is remove all suggested deps and try R CMD check. More details in R-exts.

@Robinlovelace
Copy link
Member

Thanks for the advice - I think it makes sense to use base plot() for examples - will update before next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants