Problems connecting RMark to MARK?

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

Problems connecting RMark to MARK?

Postby Nachoman » Tue May 31, 2011 2:47 pm

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) **********
Nachoman
 

Re: Problems connecting RMark to MARK?

Postby jlaake » Tue May 31, 2011 4:45 pm

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
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Problems connecting RMark to MARK?

Postby jlaake » Tue May 31, 2011 5:21 pm

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
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Problems connecting RMark to MARK?

Postby cooch » Tue May 31, 2011 7:17 pm

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.
cooch
 
Posts: 1652
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Re: Problems connecting RMark to MARK?

Postby Nachoman » Thu Jun 02, 2011 11:11 am

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"
>
Nachoman
 

Re: Problems connecting RMark to MARK?

Postby Nachoman » Thu Jun 02, 2011 11:17 am

Dorgot to mention I'm also on Win7,

Cheers,
N
Nachoman
 

Re: Problems connecting RMark to MARK?

Postby jlaake » Thu Jun 02, 2011 11:37 am

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
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Problems connecting RMark to MARK?

Postby Nachoman » Thu Jun 02, 2011 2:25 pm

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
Nachoman
 

Re: Problems connecting RMark to MARK?

Postby egc » Thu Jun 02, 2011 2:37 pm

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.
egc
Site Admin
 
Posts: 201
Joined: Thu May 15, 2003 3:25 pm

Re: Problems connecting RMark to MARK?

Postby binabk » Mon May 07, 2012 2:15 pm

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.
binabk
 
Posts: 2
Joined: Thu Feb 17, 2011 3:45 pm

Next

Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest

cron