Page 1 of 2
Problems connecting RMark to MARK?

Posted:
Tue May 31, 2011 2:47 pm
by Nachoman
Hi,
I am new to RMark, so I am following appendix C in Cooch & White (2008). To avoid compatibility problems, I have successfully downloaded and installed latest versions of MARK (version 6.1), R (version 2.13.0), and unzipped RMark (2.0.3) in the R library. When trying to work with the dipper example I find a problem which I think seems to suggest that RMark cannot connect to MARK? I would appreciate help with this problem (see the code below). Cheers,
Nacho
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
Loading required package: msm
Loading required package: nlme
Loading required package: plotrix
This is RMark 2.0.3
Built: R 2.13.0; ; 2011-05-29 07:56:18 UTC; windows
> data(dipper)
> summary(dipper)
ch sex
Length:294 Female:153
Class :character Male :141
Mode :character
> myexample=mark(dipper)
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file 'mark001.out': No such file or directory
********Following model failed to run : Phi(~1)p(~1) **********
Re: Problems connecting RMark to MARK?

Posted:
Tue May 31, 2011 4:45 pm
by jlaake
I'm not getting this problem but others are so it has been hard to track down. What operating system are you using? Please run the following snippet of code and send me the output.
--jeff
os=R.Version()$os
if(os=="mingw32")
{
if(!exists("MarkPath"))
{
MarkPath=Sys.which("mark.exe")
if(MarkPath=="")
if(file.exists("c:/Program Files/Mark/mark.exe"))
MarkPath="c:/Program Files/Mark/mark.exe"
else
stop("mark.exe cannot be found. Add to system path or specify MarkPath object (e.g., MarkPath='C:/Program Files (x86)/Mark'")
}else
{
if(substr(MarkPath,nchar(MarkPath),nchar(MarkPath))%in%c("\\","/"))
MarkPath=paste(MarkPath,"mark.exe",sep="")
else
MarkPath=paste(MarkPath,"mark.exe",sep="/")
}
os
MarkPath
Re: Problems connecting RMark to MARK?

Posted:
Tue May 31, 2011 5:21 pm
by jlaake
Note that if the R snippet of code doesn't work it is because the website is dropping the "\\" ("double backslash") to "\" ("single backslash) in
if(substr(MarkPath,nchar(MarkPath),nchar(MarkPath))%in%c("\\","/"))
Just add another backslash. Also add another } before os line at the bottom and it will work. I think the issue maybe that the path it is getting on XP operating systems is truncated to Program~1/Mark instead of Program Files/Mark and that is then not working in the system call. The following is what I get in Win7
+ > os=R.Version()$os
> if(os=="mingw32")
+ {
+ if(!exists("MarkPath"))
+ {
+ MarkPath=Sys.which("mark.exe")
+ if(MarkPath=="")
+ if(file.exists("c:/Program Files/Mark/mark.exe"))
+ MarkPath="c:/Program Files/Mark/mark.exe"
+ else
+ stop("mark.exe cannot be found. Add to system path or specify MarkPath object (e.g., MarkPath='C:/Program Files (x86)/Mark'")
+ }else
+ {
+ if(substr(MarkPath,nchar(MarkPath),nchar(MarkPath))%in%c("\\","/"))
+ MarkPath=paste(MarkPath,"mark.exe",sep="")
+ else
+ MarkPath=paste(MarkPath,"mark.exe",sep="/")
+ }
+ }
> os
[1] "mingw32"
> MarkPath
[1] "C:/Program Files (x86)/Mark/mark.exe"
>
--jeff
Re: Problems connecting RMark to MARK?

Posted:
Tue May 31, 2011 7:17 pm
by cooch
jlaake wrote:Note that if the R snippet of code doesn't work it is because the website is dropping the "\\" ("double backslash") to "\" ("single backslash) in
if(substr(MarkPath,nchar(MarkPath),nchar(MarkPath))%in%c("\\","/"))
The problem is avoided if the code snippet is embedded using the code meta tag (where the construct is
- Code: Select all
followed by the snippet, followed by
to close the code block.
So
- Code: Select all
[code]
if(substr(MarkPath,nchar(MarkPath),nchar(MarkPath))%in%c("\\","/"))
[/code]
which renders as
- Code: Select all
if(substr(MarkPath,nchar(MarkPath),nchar(MarkPath))%in%c("\\","/"))
No also that it renders with a convenient 'select all' link, allowing you to select even large code snippets easily (for the usual select, copy, paste sequence).
So, for you RMark types, try embedding everything within code blocks.
Re: Problems connecting RMark to MARK?

Posted:
Thu Jun 02, 2011 11:11 am
by Nachoman
Thanks Jeff & Evan,
This is what I get from the piece of code you sent me. Hope this helps in any way,
Nacho
- Code: Select all
> os=R.Version()$os
> if(os=="mingw32")
+ {
+ if(!exists("MarkPath"))
+ {
+ MarkPath=Sys.which("mark.exe")
+ if(MarkPath=="")
+ if(file.exists("c:/Program Files/Mark/mark.exe"))
+ MarkPath="c:/Program Files/Mark/mark.exe"
+ else
+ stop("mark.exe cannot be found. Add to system path or specify MarkPath object (e.g., MarkPath='C:/Program Files (x86)/Mark'")
+ }else
+ {
+ if(substr(MarkPath,nchar(MarkPath),nchar(MarkPath))%in%c("\\","/"))
+ MarkPath=paste(MarkPath,"mark.exe",sep="")
+ else
+ MarkPath=paste(MarkPath,"mark.exe",sep="/")
+ }
+ }
> os
[1] "mingw32"
> MarkPath
[1] "c:/Program Files/Mark/mark.exe"
>
Re: Problems connecting RMark to MARK?

Posted:
Thu Jun 02, 2011 11:17 am
by Nachoman
Dorgot to mention I'm also on Win7,
Cheers,
N
Re: Problems connecting RMark to MARK?

Posted:
Thu Jun 02, 2011 11:37 am
by jlaake
Version 2.0.4 has been posted to CRAN. It should fix the problem you were having. It is not on all mirror sites but is on the Austria site.
Ps the email address that accompanies your messages rejects all emails in case you didn't know.
--jeff
Re: Problems connecting RMark to MARK?

Posted:
Thu Jun 02, 2011 2:25 pm
by Nachoman
Hi Jeff,
thanks for the tip, hopefully it should work.
I have tried to change the email address in my user profile but I cannot change it, for some reason it just lets me to type in a new password, but there is no typing box for the email. Do you know a way to fix it? (perhaps this is a question for another forum, so sorry about that)
Anyway, I'll let you know if Version 2.0.4 works,
Cheers again,
N
Re: Problems connecting RMark to MARK?

Posted:
Thu Jun 02, 2011 2:37 pm
by egc
Nachoman wrote:I have tried to change the email address in my user profile but I cannot change it, for some reason it just lets me to type in a new password, but there is no typing box for the email. Do you know a way to fix it? (perhaps this is a question for another forum, so sorry about that)
That is actually by design -- individual users aren't allowed to change their email addresses themselves. This is an 'anti-spam' feature (since spammers often try to register with a legitimate-looking address, later switching to something more nefarious). If you want to change/correct an email address, send me a note, and it will be taken care of.
Re: Problems connecting RMark to MARK?

Posted:
Mon May 07, 2012 2:15 pm
by binabk
I am having the similar problem. This is the error message I am getting
Error in run.mark.model(model, invisible = invisible, adjust = adjust, :
mark.exe cannot be found. Add to system path or specify MarkPath object (e.g., MarkPath='C:/Program Files (x86)/Mark'
********Following model failed to run : Phi(~1)p(~1)Lambda(~1) **********
I have specified the Markpath in Rprofile site. I am using Windows 7 and installed latest version of MARK and R.