0

I'm trying to validate a column in a dataset using validate package in R.

To validate the column, I'm using a list from a csv that contains different "size" values.

library(validate)
data(SBS2000)

rule <- validator(size %in% read.csv("validationlist.csv")$size)
out <- confront(SBS2000, rule)
summary(out)

The output is telling that there are no rows in my dataset to check ("passes = 0" but should be 60)

name items passes fails nNA error warning                    expression
1   V1     0      0     0   0  TRUE   FALSE size %vin% read.csv[["size"]]

Why is the confront function not working?

Andre230
  • 145
  • 1
  • 9
  • 1
    What are the contents of the `validationlist.csv` file? It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. The only size values in SBS2000 are: sc0, sc1, sc2, sc3. Is that's what is in the size column of your csv file? – MrFlick Feb 28 '23 at 14:54
  • @MrFlick, yes sc0, sc1, sc2, sc3 are present in the size column of **validationlist.csv** – Andre230 Mar 01 '23 at 10:13

0 Answers0