Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_occ not working but loads fine in gui() #126

Open
ikonig opened this issue Apr 17, 2023 · 2 comments
Open

load_occ not working but loads fine in gui() #126

ikonig opened this issue Apr 17, 2023 · 2 comments

Comments

@ikonig
Copy link

ikonig commented Apr 17, 2023

Hi!

I am trying to model by manually typing in the connsole but I have an issue with using load_occ function.

Occurrences loading
Error in .xyValues(x, as.matrix(y), ...) : xy should have 2 columns only.
Found these dimensions: 850, 0

However, when I load with gui, it doesn't have any error.

I'm using this code:
load_occ(path = getwd(), Env, file = "Main_Occurrence_CL.csv", Xcol = "longitude",
Ycol = "latitude", Spcol = "species", GeoRes = FALSE, verbose = TRUE, GUI = FALSE)

Thank you in advance!

@ikonig
Copy link
Author

ikonig commented Apr 17, 2023

Also, I would like to follow-up another error when using a different code:

Occurrences loading
[1] species longitude latitude
<0 rows> (or 0-length row.names)
Warning message:
In load_occ(path = getwd(), Env, file = "Main_Occurrence_CL.csv", :
You have occurrences that aren't in the extent of your environmental variables, they will be automatically removed !

load_occ(path = getwd(), Env, file = 'Main_Occurrence_CL.csv', Xcol = "longitude", Ycol = "latitude", Spcol = 'species', sep = ',')

@sylvainschmitt
Copy link
Owner

Have you tried the minimal example:

> load_occ(path = system.file('extdata',  package = 'SSDM'), Env,
+          Xcol = 'LONGITUDE', Ycol = 'LATITUDE',
+          file = 'Occurrences.csv', sep = ',')
Occurrences loading 
1 geographical resampling 
        SPECIES LONGITUDE  LATITUDE
1     elliptica  164.1833 -20.28333
3     elliptica  164.1999 -20.44999
5     elliptica  164.5166 -20.39999
8     elliptica  164.7666 -20.74999

Because this is working fine on my side. In which case it is an environment issue. Please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants