On Jun 15, 2012, at 3:43 PM, Brent Hendrixson wrote:
Hi David -
Looking at the package documentation I see this:
maxent: A list containing the location of the MAXENT application and
its input files (see
details).
Maybe I was wrong about 'spec' and the malformed argument is
'maxent'.
If I had been constructing it I would have created a _named_ list:
maxent <- list( app =app,
samples =samples,
background, # cannot tell if a csv file meets the
requiremtn
# "The path to a SWD-formatted file with
background points."
projections =projections) # that value .../R looks
pretty suspicious, too.
Your advice definitely helped - THANK YOU! However, I'm now getting
another error that seems to be tied to the maxent java program
itself. Here's the syntax I have used for the
niche.equivalency.test (recall that it consists of 4 elements: spec,
n, maxent, mx=2000)
spec <- c("aphonopelma_mojave", "aphonopelma_newmojave")
app <- file.path("C:\\Documents and Settings\\hendrb\\Desktop\\R\
\maxent.jar")
samples <- file.path("C:\\Documents and Settings\\hendrb\\Desktop\\R\
\samples.csv")
background <- file.path("C:\\Documents and Settings\\hendrb\\Desktop\
\R\\background.csv")
projections <- file.path("C:\\Documents and Settings\\hendrb\\Desktop
\\R")
maxent <- list(app=app, samples=samples, background=background,
projections=projections)
After I defined each of those, I tried to execute the command as
follows:
niche.equivalency.test(spec, n=100, maxent, mx=2000)
And here was the message I received:
Unable to access jarfile C:\Documents
That hanging "Documents" being listed as the file target makes me
think that the file specification is creating errors due to spaces in
Windows directories. In Windows it is often the case that backslashes
need to be doubled or replaced with forward slashes.I see that you
already know that, but would have tried the forward slash gambit as
well. (I am not sure why you are passing hte results of file.path(...)
when you already have a complete file name. I would also try just
giving it a file specification with just a character argument.)
Error in file(file, "r") : cannot open the connection
In addition: Warning messages:
1: running command 'java -mx2000m -jar C:\Documents and Settings
\hendrb\Desktop\R\maxent.jar -e R.phyloclim.temp/background.csv -s
R.phyloclim.temp/samples.csv -j C:\Documents and Settings\hendrb
\Desktop\R -o R.phyloclim.temp/out -r removeduplicates nopictures
outputformat=raw autorun' had status 1
2: In file(file, "r") :
cannot open file 'aphonopelma_mojave_C:\Documents and Settings
\hendrb\Desktop\R.asc': Invalid argument
Like I mentioned, it seems that this particular error is unrelated
to R code but I'm unsure why the jarfile (maxent.jar) cannot be
accessed.
Any thoughts?
The above command did produce a new file that serves as the input
for the jarfile.
Thanks again for your help!
Brent
David Winsemius, MD
West Hartford, CT
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.