-
Notifications
You must be signed in to change notification settings - Fork 1
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
stringsAsFactors = TRUE needs to happen before R4.0.0 happens. See Hornik email. #8
Comments
tvctomat() lives in ./R/objectrm.r (see chunk below). It has it's own ./man/.Rd file. Find where interaction = TRUE comes into play … 1st instance of data.frame inside tvctomat is line 931 where the interaction if() statement starts on line 1022. So apparently the calls to data.frame before the interaction are ok. Something about the calls inside the interaction if() is triggering the error… I seem to remember that rmutil has its own definition of data.frame some where…let's see… ah yes, it is in the same file, objectrm.r on line near the bottom. It is not data.frame but Ergh. So what's the recommended fix, here. I have a lot of calls to data.frame. Is it possible that interaction==TRUE only calls as.data.frame...(?) Answer: No. And it is interesting: Interaction if() loop goes from line 1022 to 1133. Doing a ctrl+f in that region, all 8 times Best case scenario: we put in the stringsAsFactors=TRUE into the as.data.frame() definition and it propogates everywhere it is used and it solves our problems. Worse case … find every instance of
|
Okay, I have reproduced the error so easily with
|
I noticed that the example for has a data.frame call in it -- what if all my problems are gone if I just change the argument in that one, single, data.frame() call?
Change the last line in chunk above to
and rerun: it bombed. ok, comment the offending line and everything after it and resubmit. spoiler alert: everything is ok! so, need to look inside interaction if() loop.
|
Okay, slowly peeled off the commented code and it turns out, the only offending line is when
|
Googled `Error in dimnames(x) <- dn : And got this closed SO thread: https://stackoverflow.com/q/32464829/2727349 Will focuse on colnames() calls in the interaction length =2 portion. |
So I've put in some print statements and am running things without errors (locally, with SFT+CMD+B and then running a line from the example) and against dev externally with The debugging print-statements laden chunk:
With errors against devel:
without errors locally:
|
So Let's just focus on the levels, since the tmp dataset looks the same and the units look the same.
Well,
I've run this with both
and it made no difference. So what is and we test each of those conditions and come upon |
Line 970 locally:
against devel:
So this brings to question how was
it's so weird that toggling the stringsAsFactors=TRUE didn't affect things. So somehow tvc2 must have levels in my local instance and not have levels in the against devel instance and I confirm this with a print statement just inside the function call: local:
against-devel:
|
I finally got smart and put a locally:
against-devel:
And there it is. Clearly. I should have done it first thing. I search for |
Nada! Denied. After many more hours of digging, I have found the culprit. Around line 939, we define tvcv. I put in a print statement to see how the
which has output locally:
and against-devel:
So how do I ensure that |
15 minutes later -- assigning a data.frame(obj, stringsAsFactors=TRUE) when the obj is already a data.frame that has attributes set doesn't appear to change those attributes. So, I can't just add another line after the defined obj and change it. But, what if I took the offending line:
and forced it to be character and then made it a data.frame with the argument set to TRUE, as in:
Local tests show that I get the same output except for the dimension name now being uglier with
|
Okay, the answer is:
Survey says! ---------------> NOT QUITE YET BUT PROGRE$$ has been made! Look at the progress in the against-devel: tvc2 and tvc4 form correctly! But we messed up
but we messed up the following call
Luckily that print statement from the first line was installed and worked. BUT WAIT! -- Looks like the damage was self inflicted from a print statement. To confirm, we comment out the following and rerun and we achieve against-devel success!
|
Ok, so now do the git checkout thing on some files and just implement the following:
|
Updated NEWS.md
|
Dear maintainer, thanks, package rmutil_1.1.4.tar.gz is on its way to CRAN. Best regards, No changes to worse in reverse depends. |
Ok. Go to https://cran.r-project.org/web/checks/check_results_rmutil.html and click on devel-windows. Examples are bombing:
Looks like
tvctomat
wheninteraction = TRUE
is the culprit because of the four lines below the 1st three are non-problematic but the 4th one errors:The text was updated successfully, but these errors were encountered: