pharmaverse / pharmaverse/rtables
`.path_to_pos()` fails when `path` contains regular expression symbols
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 260
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
The code at https://github.com/insightsengineering/rtables/blob/main/R/tt_pos_and_access.R#L995 can't match paths that contain regular expression symbols like +. For example:
pathregex <- "gear + carb"
pathstrs <- c("gear + carb`3 + 1", "gear + carb`3 + 2")
grep(pathregex, pathstrs)
# integer(0)
Adding fixed = TRUE to grep() seems a solution, but it would affect the function of character *.
See also https://github.com/johnsonandjohnson/junco/issues/100
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect R/tt_pos_and_access.R around line 995 and reproduce the example using grep() with the path containing '+'. Check how the matching logic treats regular-expression symbols and character ''. Done means paths containing '+' match correctly without breaking the existing '' behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100