I would be grateful if anyone could tell me what the error message: Error in NN[i, 1:length(od)] <- od : subscript out of bounds means for a large .csv file containing gps coordinates. I am using package SPACECAP and have successfully run it with other .csv files but now keep getting this error message. I can't see anything wrong with the file which is simply three columns of data. I am relatively new to R and am at a loss as to what I can do to correct this. Can anyone help? Thanks Vivien -- View this message in context: http://r.789695.n4.nabble.com/Error-message-for-csv-file-tp3807651p3807651.html Sent from the R help mailing list archive at Nabble.com.
Hi, On Mon, Sep 12, 2011 at 11:07 AM, vkent <vivien.kent at gmail.com> wrote:> I would be grateful if anyone could tell me what the error message: > > Error in NN[i, 1:length(od)] <- od : subscript out of boundsIt means that either i ends up being larger than the number of rows in NN, or that length(od) ends up being larger than the number of columns. More than that we can't tell you without more information, like, say, a reproducible example, or at least some information like str(NN) dim(NN) length(od) and where i comes from. How you got the csv file into R might also be relevant, or not.> means for a large .csv file containing gps coordinates. I am using package > SPACECAP and have successfully run it with other .csv files but now keep > getting this error message. I can't see anything wrong with the file which > is simply three columns of data. > > I am relatively new to R and am at a loss as to what I can do to correct > this. > > Can anyone help? > > Thanks > > Vivien >-- Sarah Goslee http://www.functionaldiversity.org
Go to your R session. First off, tell the R-help list how you got your csv file into R as NN. read.csv() ? read.table()? Then tell us exactly what code you're using. Where did i come from? Also type in exactly the commands I gave you (four lines), and share the output with the R-help list. str(NN) dim(NN) length(od) i The likely problems: either you imported the csv file incorrectly, or there's something wrong with the code (a loop?) in which it is processed. Without the R commands you used for either, there's no way to tell which, or what. Sarah On Mon, Sep 12, 2011 at 12:49 PM, Vivien Kent <vivien.kent at gmail.com> wrote:> Hi, > > I don't really understand what all that means I'm afraid. I am attaching the > csv file which is just a list of coordinates classified as either habitat or > non habitat. The other data I enter into the package are locations of > captures (of animals) and locations of camera traps. I have got it to run in > other scenarios with more rows so don't see what the problem can be. > > Thanks > > Vivien > > On 12/09/2011 17:43, Sarah Goslee wrote: > > Hi, > > On Mon, Sep 12, 2011 at 11:07 AM, vkent <vivien.kent at gmail.com> wrote: > > I would be grateful if anyone could tell me what the error message: > > Error in NN[i, 1:length(od)] <- od : subscript out of bounds > > It means that either i ends up being larger than the number of rows in > NN, or that length(od) ends up being larger than the number of > columns. > > More than that we can't tell you without more information, like, say, > a reproducible example, or at least some information like > str(NN) > dim(NN) > length(od) > and where i comes from. > > How you got the csv file into R might also be relevant, or not. > > means for a large .csv file containing gps coordinates. I am using package > SPACECAP and have successfully run it with other .csv files but now keep > getting this error message. I can't see anything wrong with the file which > is simply three columns of data. > > I am relatively new to R and am at a loss as to what I can do to correct > this. > > Can anyone help? > > Thanks > > Vivien > >-- Sarah Goslee http://www.functionaldiversity.org
Hi Torrey Yes - it turned out that it wasn't a problem with the .csv file it was a problem with SPACECAP. I was trying to use too small a pixel size for the home range centres. The smallest pixel size that SPACECAP can handle is 0.25 sq km. Hope this helps Vivien On 07/02/2013 05:14, twrodgers [via R] wrote:> Hi Vivien, > I was wondering if you ever figured out how to fix this problem. I am > having the same problem and could use help. Please let me know if you > figured it out. > Thanks, > Torrey > > ------------------------------------------------------------------------ > If you reply to this email, your message will be added to the > discussion below: > http://r.789695.n4.nabble.com/Error-message-for-csv-file-tp3807651p4657770.html > > To unsubscribe from Error message for .csv file, click here > <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3807651&code=dml2aWVuLmtlbnRAZ21haWwuY29tfDM4MDc2NTF8LTE3MzY2ODcxODg=>. > NAML > <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >-- Vivien Kent Vivien Kent, MSc (Oxon), PhD (Dunelm) Wildlife Biologist and Photographer Email: vivien.kent@gmail.com <mailto:vivien.kent@gmail.com> Website: www.vivienkent.com <http://www.vivienkent.com> Tel: +44(0)191 3719 233 Mob: +44 (0)7775 558167 -- View this message in context: http://r.789695.n4.nabble.com/Error-message-for-csv-file-tp3807651p4657781.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]