metrumresearchgroup / yspec

Data Specification for Pharmacometrics
https://metrumresearchgroup.github.io/yspec
5 stars 2 forks source link

ys_reorder() function #134

Open andreashandel opened 2 years ago

andreashandel commented 2 years ago

simple function that re-orders data to conform to yspec order and make ys_check() happy. Took me a bit of googling (going through example project) to find the (simple) syntax. Quick helper function could be nice. Basically this function:

ys_reorder <- function(data,spec) {

input checks for valid data and spec objects as needed

datout <- select(data, names(spec))
return(datout)

}