atorus-research / xportr

Tools to build CDISC compliant data sets and check for CDISC compliance.

Home Page:https://atorus-research.github.io/xportr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code for formats where there is an `x.y` is currently not creating all combinations within `xpt_validate()` function.

sophie-gem opened this issue · comments

Within the utility function xpt_validate() in utils-xportr.r - there is a section where a vector of expected_formats is created. Whilst looking through this for ideas for #164, I noticed that lines 259, 262, 267, 276 are not creating all combinations of the vectors of numbers, that is the second vector is instead being recycled to the length of the first. For example, take line 259:

image

This gives the output:

image

whereas I think it should say, "E8601TM8.0" "E8601TM8.1" "E8601TM8.2" ... etc.

Think this can be resolved by using the sort() and rep() functions. Something like, paste("E8601TM", 8:15, ".", sort(rep(0:6, 8)), sep = "").

@elimillera - we decided to just correct this issue as part of the xportr_format() issue.