?data.frame will show na.action is not an argument to data.frame.
na.omit(data.frame(east(G), north(G), sites1)) might be what you want.
On Mon, 13 Oct 2003, Martin Wegmann wrote:
> I run R inside GRASS and tried to obtain values of a raster file inside
GRASS
> but this raster image contains only a few relevant pixel and approx. 1.5
> Mill. NA's, I did
>
> G <- gmeta()
> sites1 <- rast.get(G, "sites1")
> df.sites1 <- data.frame(east(G), north(G), sites1, na.action=na.omit)
> Error in as.data.frame.default(x[[i]], optional = TRUE) :
> can't coerce function into a data.frame
>
> executing it without na.action works fine but with 1.5 Mill. redundant
values.
>
> any advice how I receive the relevant 100 values without the NA's?
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595