Giter Club home page Giter Club logo

Comments (7)

mlammens avatar mlammens commented on August 17, 2024 1

@kgahm Do you have a species column in your data frame? That's required for this program to work correctly.

from spthin.

mlammens avatar mlammens commented on August 17, 2024

@GisKid Sorry for the long delay. You still having this error? It looks like it may be a case of having too few data points, but I'd need to know more about the dataset you're dealing with to be sure.

from spthin.

yeelauren avatar yeelauren commented on August 17, 2024

from spthin.

mlammens avatar mlammens commented on August 17, 2024

Oh interesting. I have to admit that I never tested the code on anything other than long/lat in decimal-degree format. Is this UTM? The distance between points is determined using the function rdist.earth in the fields package. Best I can tell, it doesn't return reasonable distances with the 6 points you have above. Is it possible to convert them to a decimal degree format? I'll have to think about adding conversions into future editions of spThin.

from spthin.

kaijagahm avatar kaijagahm commented on August 17, 2024

I'm getting the same error as the above, but my coordinates are in decimal degrees.
This is the code that produces the error:
thinned <- thin(loc.data = data, lat.col = "lat", long.col = "lon", thin.par = 1, reps = 10)

and this is the error message itself:
Error in .subset2(x, i, exact = exact) : attempt to select less than one element in get1index.

Here's a bit of my data:

head(data)
lon lat
-91.34398 -0.29502
-91.34030 -0.29467
-91.34172 -0.29463
-91.33602 -0.29402
-91.33930 -0.29394
-91.33914 -0.29369

Any idea what might be going on here? Are my coordinates in the wrong format, or could there be a different issue?

Thank you!

from spthin.

kaijagahm avatar kaijagahm commented on August 17, 2024

@mlammens thanks for getting back to me so quickly! That was indeed the problem, and it's working now.

I think I got confused about this because the documentation says that the loc.data object "can include several columns, but must include at minimum a column of latitude and a column of longitude values." So I didn't realize a species column was required.

If you get the chance, it might be helpful to include a note that the species column is also required. But anyway I probably should have known to try that...

Thanks again for your help!

from spthin.

mlammens avatar mlammens commented on August 17, 2024

Thanks @kgahm. I'll add a note to fix that documentation.

from spthin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.