0

I'm applying the function image(cp) to gps data but when I do so it throws up the following error

Error in image(as(x, "SpatialGridDataFrame"), ...) : 
  error in evaluating the argument 'x' in selecting a method for function 'image': Error: cannot allocate vector of size 12.3 Mb

The SpatialPointsDataFrame of my relocation gps data has two columns. One with the coordinates, the other with the ID of the animal.

I'm running it on a 32 bit system with 4 gigs of RAM.

How do I get around this?

2
  • 3
    Install more memory? But seriously now, please help us help you by providing us with a reproducible example (i.e. code and example data), see stackoverflow.com/questions/5963269/… for details. Commented May 21, 2013 at 12:13
  • R might not be using all of the memory it can. First clean your workspace with rm, then take a look at ?memory.limt to see how to check how much RAM is alotted to R and how to request more. Commented May 21, 2013 at 12:30

1 Answer 1

1

One way that might work with no thinking required:

library(raster)
r <- raster(cp)
image(r)

But, you say cp is "gps data" so it's not at all clear why this would be imageable.

One thing you can do is plot it:

plot(cp)

That will work for a SpatialPointsDataFrame. If you want to create an image from this somehow you'll need to specify some details.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.