0

I'm trying to run VariableSelection function in MaxentVariableSelection but stuck with the error saying

Error in read.table(file = file, header = header, sep = sep, quote = quote, : no lines available in input

Here is the code I am using,

MaxentVariableSelection::VariableSelection(maxent="c:/Users/Piyali/Downloads/Software/maxent/maxent.jar", 
              outdir="/Users/Piyali/Desktop/msc_paper/R_SDM/outputtest", 
              gridfolder="/Users/Piyali/Desktop/msc_paper/R_SDM/30sclippedascii",
              occurrencelocations="/Users/Piyali/Desktop/msc_paper/R_SDM/occ_full.csv",
              backgroundlocations="/Users/Piyali/Desktop/msc_paper/R_SDM/bg_full.csv",
              additionalargs="additionalargs",
              contributionthreshold=5, 
              correlationthreshold=0.9,
              betamultiplier=seq(2,6,0.5))

Any idea to solve this, please?

Dias'90
  • 1
  • 1
  • Hi can you provide minimal example of your csv format ? See https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610 – Gowachin Apr 22 '21 at 18:43
  • Hi Gowachin, Sorry, I'm struggling to post my code here as I'm new to R as well as stackoverflow posting, but please find it here https://github.com/pdias1990/begonia/blob/master/maxent_tuning.R Hope this what you were asking. – Dias'90 Apr 23 '21 at 08:43
  • Hi @Dias'90, I think your github repository is private so we can't access it. – Gowachin Apr 23 '21 at 10:10
  • Hi Gowachin, Very sorry for the inconvenience. I have set the visibility settings to public now. – Dias'90 Apr 23 '21 at 14:10
  • Hi, my question was more about the data inside `occ_full.csv` and `bg_full.csv`. It's a difficult problem to solve when not looking at these files. I saw that you construct these two with cbind, is it possible to have `nrow(occ_full)` before the export ? Does the package allow for NA values ? – Gowachin Apr 24 '21 at 15:16
  • Hi, Thanks, Gowachin! Yes, it returns the value of 'nrow(occ_full)' , and I hope the package allows for NAs but I'm not sure about it. I'll upload the sample dataset I'm using to my GitHub repository https://github.com/pdias1990/begonia/blob/master/maxent_tuning.R if you are happy to look at. – Dias'90 Apr 25 '21 at 07:58
  • 1
    Hi Gowachin, I just solved this error by setting No numbering before 'species' column and set the working directory in R to where all remaining files are contained in (layers folder, occurrence csv, background csv, and Maxent programme files). And Yes! there should not have any NAs in data. However, now I'm getting a different error :( Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", : Cannot create a RasterLayer object from this file. (file does not exist) – Dias'90 Apr 25 '21 at 12:52

0 Answers0