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

Arith - bare negate fails #21

Closed
mdsumner opened this issue Nov 1, 2018 · 1 comment
Closed

Arith - bare negate fails #21

mdsumner opened this issue Nov 1, 2018 · 1 comment

Comments

@mdsumner
Copy link
Contributor

mdsumner commented Nov 1, 2018

Very low importance, but I noticed this doesn't work.

library(raster)
r <- raster(volcano)
-r
# Error in -r : invalid argument to unary operator
0 - r ## is ok
@rhijmans
Copy link
Member

rhijmans commented Nov 2, 2018

Thanks for bringing that up and for the code suggestion. Fixed: 5e18157#commitcomment-31141037

I now get:

library(raster)
r <- raster(volcano)
-r
#class       : RasterLayer 
#dimensions  : 87, 61, 5307  (nrow, ncol, ncell)
#resolution  : 0.01639344, 0.01149425  (x, y)
#extent      : 0, 1, 0, 1  (xmin, xmax, ymin, ymax)
#coord. ref. : NA 
#data source : in memory
#names       : layer 
#values      : -195, -94  (min, max)

@rhijmans rhijmans closed this as completed Nov 2, 2018
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