3

I am trying to create kernel density estimates for bird territories over a number of years. So I have all of the x,y coordinates that mark the locations of each bird in my spreadsheet, and columns for Year and Bird ID. I want to create a kernel density estimate for each bird's territory each year - some birds have returned in multiple years and established territories, so I need a KDE for each bird, each year. I can get it to work doing it one at a time, but that would be time consuming and unpleasant with 100's of unique combinations of Bird ID and Year to go through, so I have been trying to batch automate it and am running into trouble.

This is what I put in the command text on the GME GUI:

inpath <- ”V:\shapefiles\” 
outpath <- ”V:\shapefiles\” 
for (i in 1:44) 
   { for (j in 2009:2015) 
       { kde(in=paste(inpath, ”Master6.shp”), 
            out=paste(outpath, ”kde an”, i, ” m”, j, ”.img”), 
            bandwidth="SCV", 
            cellsize=0.000168, 
            where=paste(”Bird ID=”, i, ” ANDYear=”, j)); 
        }; 
    };

This is the output and error I get:

inpath <- "V:\shapefiles\" 
outpath <- "V:\shapefiles\" 
for (i in 1:44);   
kde(in=paste(inpath, "Master6.shp"), 
out=paste(outpath, "kde an", i, " m", 2009, ".img"), 
bandwidth="SCV", cellsize=0.000168, 
where=paste("Bird ID=", i, " ANDYear=",   2009));

Error: The default input/output working folders have not been specified, therefore not enough information has been supplied to open the specified data source

Error: Could not open input point data source.

I'm new to GME.

1 Answer 1

2

There are a few things that need to be cleaned up in your code example. I think the quotes may clean up the input source error you are receiving, if not, changing from a mapped drive to UNC might.

  1. You need a space between AND & Year in your last line.

  2. Check your quotations. You may need to either find and replace or manually change them up. They're different in your code vs the Example Code from GME

  3. Bandwidth likely needs an integer, not a string.

  4. Make sure your V: Drive/folder are accessible. If this is a network drive you may want to use the UNC path instead of a mapped drive.

    Example code from GME (site referenced above):

inpath <- "C:\data\"
outpath <- "C:\output\"
for (i in 1001:1010) {
 for (j in 1:12) {
kde(in=paste(inpath, "telemetry.shp"), 
out=paste(outpath, "kde_an", i, "_m", j, ".img"), bandwidth=1000,
cellsize=r.eval((250000-120000)/2000), where=paste("ANIMALID=", i, "
     AND MONTH=", j));
};
 };

Versus your code:

inpath <- ”V:\shapefiles\” 
outpath <- ”V:\shapefiles\” 
for (i in 1:44) 
   { for (j in 2009:2015) 
       { kde(in=paste(inpath, ”Master6.shp”), 
            out=paste(outpath, ”kde an”, i, ” m”, j, ”.img”), 
            bandwidth="SCV", 
            cellsize=0.000168, 
            where=paste(”Bird ID=”, i, ” ANDYear=”, j)); 
        }; 
    };

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.