[GRASS-stats] writeRAST fails to write empty raster

Roger Bivand Roger.Bivand at nhh.no
Thu Jun 11 14:38:56 PDT 2015


On Thu, 11 Jun 2015, Anna Petrášová wrote:

> Hi,
>
> I am using R rgrass7 package and it seems that when writing a raster which
> has only NA, it fails with "only numeric values may be exported":
>
> https://github.com/cran/rgrass7/blob/386b11e5a2f3879ec63d299c0594f55cbd39c8e5/R/bin_link.R#L446

This site has nothing whatsoever to do with anything, and is certainly 
unauthorised. Please only refer to R-Forge:

https://r-forge.r-project.org/scm/viewvc.php/pkg/rgrass7/R/bin_link.R?view=markup&revision=25&root=spgrass

shows the full context, file name, but not line number.

Are your NAs numeric?

> is.numeric(NA)
[1] FALSE
> is.numeric(as.numeric(NA))
[1] TRUE


>
> Is this intended behavior or a bug?

User misunderstanding. NAs are logical unless created in the context of an 
object with a different storage mode.

>
> Thank you,
>
> Anna
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no


More information about the grass-stats mailing list