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

Results of Resubmission 2: An error in cmcre! #12

Open
swihart opened this issue Nov 30, 2016 · 1 comment
Open

Results of Resubmission 2: An error in cmcre! #12

swihart opened this issue Nov 30, 2016 · 1 comment

Comments

@swihart
Copy link
Owner

@swihart swihart commented Nov 30, 2016

So I have passed checks on the 3 platforms. Cran's check failed.

* checking examples ... ERROR
Running examples in ‘repeated-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: cmcre
> ### Title: Continuous-time Two-state Markov Processes with Random Effect
> ### Aliases: cmcre
> ### Keywords: models
>
> ### ** Examples
>
>
> # 12 subjects observed at intervals of 7 days
> y <- matrix(c(1,7,1,2,3,5,
+       2,7,10,2,2,0,
+       3,7,7,0,1,1,
+       4,7,2,1,0,7,
+       5,7,1,1,1,11,
+       6,7,5,4,4,1,
+       7,7,1,1,1,8,
+       8,7,2,3,4,2,
+       9,7,9,0,0,0,
+       10,7,0,1,2,8,
+       11,7,8,2,2,1,
+       12,7,9,2,2,1),ncol=6, byrow=TRUE)
> # ordinary Markov process
> cmcre(y, par=c(-0.2,-1))
Error in cmcre(y, par = c(-0.2, -1)) :
  array over-run in .C("LoadData") in integer argument 4
Calls: cmcre -> .C
Execution halted

Look at lines 207-214 in cmcre.r

x <- .C("LoadData",
	response=as.double(t(cbind(response[,1],1,response[,2:6],covariate))),
	nrow=as.integer(dim(response)[1]),
	nSize=as.integer(dim(response)[2]+1+cov),
	NumSubjects=integer(1),
	Error=integer(1),
	PACKAGE="repeated")
if(x$Error>0)stop("error in storing data")

I think we are dealing with the line nSize=as.integer(dim(response)[2]+1+cov), and one thing I see is that cov is logical...is that causing a problem?

No, no. The error says array and the nSize is an integer scalar. My money is on
plNumSubjects being argument 4 in lines 34-37 of gaps.c:

LoadData( double *response, int *nrow, int *nSize,
          long * plNumSubjects, 
          long *plReturn )
{

In cmcre.r, plNumSubjects corresponds to NumSubjects=integer(1),. interger(1) is a way of making an array that is length 1. Somewhere in the c it might be made longer... and this stuff sometimes throws an error with compiling nad sometimes not (is my impression from reading stuff).

@swihart
Copy link
Owner Author

@swihart swihart commented Nov 30, 2016

kurt said he was using:

Debian testing with the GCC 6 compilers.

I vote to remove cmcre for now. LoadData is only used in it. See if we can repeated on cran. I will add it to .Rbuildignore.

> devtools::use_build_ignore("./R/cmcre.r")
> devtools::use_build_ignore("./man/cmcre.Rd")

... and .Rbuildignore didn't work. So I exported them out of the /R folder and out of /man folder into package directory and then edited .Rbuildignore and now they are ignored. undo these when you want to bring cmcre back into the fold

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.