You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Patching a bug caused by an issue with the terms function in the stats package.
For very long feature names, such as those introduced by using the ridge function with many parameters the terms function splits the variable names by inserting a new line character.
Heres a demo example: terms(as.formula(paste0('~ridge(',paste0('variable',1:50,collapse = ','),',theta = 1,scale = TRUE)')))
returns an object where attr(,"term.labels") and attr(,"factors") names have been split by a new line character '\n' (for me this was around variable 42).
The reason this is a problem is because later on in the coxph function (lines 541 and 543 here) it tries to match a version of the string with the newline character (attr(Terms, 'term.labels') and names(assign)) and one without (pname). It fails and returns NA. This in turn falsely triggers the error on line 542.
Please take note of the very first lines in coxph.r. --- the file is automatically derived from the actual source in the now directory. Any patches have to be there.
Patching a bug caused by an issue with the terms function in the stats package.
For very long feature names, such as those introduced by using the ridge function with many parameters the terms function splits the variable names by inserting a new line character.
Heres a demo example: terms(as.formula(paste0('~ridge(',paste0('variable',1:50,collapse = ','),',theta = 1,scale = TRUE)')))
returns an object where attr(,"term.labels") and attr(,"factors") names have been split by a new line character '\n' (for me this was around variable 42).
The reason this is a problem is because later on in the coxph function (lines 541 and 543 here) it tries to match a version of the string with the newline character (attr(Terms, 'term.labels') and names(assign)) and one without (pname). It fails and returns NA. This in turn falsely triggers the error on line 542.
Ahh sorry about that, I have now done the patch in the coxph.Rwd file in the noweb directory and rerun "make all -f Makefile".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Patching a bug caused by an issue with the terms function in the stats package.
For very long feature names, such as those introduced by using the ridge function with many parameters the terms function splits the variable names by inserting a new line character.
Heres a demo example:
terms(as.formula(paste0('~ridge(',paste0('variable',1:50,collapse = ','),',theta = 1,scale = TRUE)')))returns an object where attr(,"term.labels") and attr(,"factors") names have been split by a new line character '\n' (for me this was around variable 42).
The reason this is a problem is because later on in the coxph function (lines 541 and 543 here) it tries to match a version of the string with the newline character (attr(Terms, 'term.labels') and names(assign)) and one without (pname). It fails and returns NA. This in turn falsely triggers the error on line 542.