Comments (7)
@kgahm Do you have a species column in your data frame? That's required for this program to work correctly.
from spthin.
@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.
from spthin.
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.
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.
@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.
Thanks @kgahm. I'll add a note to fix that documentation.
from spthin.
Related Issues (20)
- Identify "best" results from heuristic thinning? HOT 1
- write.SpThin did not save to dir HOT 1
- Make species column optional HOT 1
- Check that out.dir is optional in next version
- SUGGESTION - output spatial data object
- thin.par HOT 3
- thin multiple species based on spec.col HOT 3
- Output additional columns? HOT 3
- Unexpectedly (?) long run time for a large dataset HOT 2
- Location points moving HOT 4
- thin.algorithm doesn't work with tibbles
- Avoid full distance matrix within thin.algorithm() to allow for thin() on a large number of points? HOT 9
- error HOT 1
- Error in .subset2(x, i, exact = exact) : attempt to select less than one element in get1index HOT 9
- Using ENMeval to tune Maxent settings and getting exactly the same results for two disjunct species HOT 1
- Error (error: In path.expand(path)) from spThin::thin(..., write.files = TRUE) resulting from long file names where a dataset with where "spec.col" has many levels
- Is there a way to keep the most recent record? HOT 1
- what input projection for spThin HOT 2
- Help Please: I get this error: Error in .subset2(x, i, exact = exact) : attempt to select less than one element in get1index HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spthin.