phuse-org / valtools

Validation framework for R packages used in clinical research and drug development.
https://phuse-org.github.io/valtools/
Other
51 stars 10 forks source link

Traceability matrix generates errors when requirements are not numbers. #223

Open PurityControl opened 2 years ago

PurityControl commented 2 years ago

Valtools version: 0.4.0 OS: macOS Big Sur 10.16 (intel 64 bit) R: 4.1.2

I'm trying to get to grips with this package but I'm have issues with the traceability matrix on the generated report.

I have watched the video linked in the README of this repository and at 11m44s it describes a test case. That test case links to a number of user requirements. These comma separated user requirements are then shown in the traceability matrix when the report is run.

If I run the report and only use numbers to refer to user requirements everything works fine.

The following code produces the image below it:

#' @coverage
#' TCAA1.1: 2.1, 2.2, 3.3

image

However, if I add letters to the user requirements as shown in the video linked above I get the following error:

#' @coverage
#' TCAA1.1: S2.1, S2.2, S2.3

image

It seems to me this section of code is the culprit.

It is expecting the requirements to be numbers in order to sort them. I'm guessing this is a bug because limiting these to just numbers seems overly restrictive and contrary to the demo in the video.

I'm new to R and so my skills are limited but I'm happy to help with this in whatever way I can.

LukasDSauer commented 1 year ago

I experienced the same problem and suggested a quick fix in a pull request.

However, in my opinion it would be nice if the requirement names match the manually given names as in the risk assessment table.