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

plot.lazyraster Roxygen: plot() and masking-related messages on package load #20

Closed
brownag opened this issue Aug 4, 2021 · 5 comments

Comments

@brownag
Copy link

brownag commented Aug 4, 2021

When loading lazyraster I get the following messages:

library(lazyraster)
#> 
#> Attaching package: 'lazyraster'
#> The following object is masked from 'package:graphics':
#> 
#>     plot
#> The following object is masked from 'package:base':
#> 
#>     plot

I think reworking lines 66-71 in lazy-methods.R

#' @importFrom graphics plot
#' @export plot
#' @rawNamespace S3method(plot,lazyraster)
#' @usage \method{plot}{lazyraster}(x, y, ...)
#' @name lazyraster-methods
#' @export

with something like...

# ...
#' @method plot lazyraster
#' @name plot
#' @rdname lazyraster-plot
#' @export

would get rid of the masking messages and show the lazyraster method in the ?plot help along with other methods

image

mdsumner added a commit that referenced this issue Aug 5, 2021
@mdsumner
Copy link
Member

mdsumner commented Aug 5, 2021

thanks! I think it's right now, much better :)

@brownag
Copy link
Author

brownag commented Aug 5, 2021

works perfect, thank YOU for this great package + {vapour}

@brownag brownag closed this as completed Aug 5, 2021
@brownag brownag reopened this Aug 5, 2021
@brownag
Copy link
Author

brownag commented Aug 5, 2021

Whoops, looks like I was mistaken. When passing lazyraster as argument after loading the package (without message), I get the following error

Error in as.double(y) : 
  cannot coerce type 'S4' to vector of type 'double'

Removing @name lazyraster-methods and replacing @aliases plot with @name plot seems to work for me; then using @rdname lazyraster-methods makes sure the plot method goes with the print/format methods.

@brownag
Copy link
Author

brownag commented Aug 5, 2021

And I was doubly-mistaken. Sorry for all the noise Your fix was perfect, I tried on different machine and was actually passing a raster object since I called as_raster on it. My bad.

@brownag brownag closed this as completed Aug 5, 2021
@mdsumner
Copy link
Member

mdsumner commented Aug 5, 2021

oh, great - thanks :)

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