I have this function called Dude. it takes Data as a required NanoStringGeoMxSet class, with Norm being "neg" input. I want to through a flag/error for user if class isnt correct. However, Data = (can be any labeled input). I want to allow class to take in this any variable to check class status. Any thoughts?
Dude <- function(Data, Norm) {
if(class(data)[1] != "NanoStringGeoMxSet"){
stop(paste0("Error: You have the wrong data class, must be NanoStringGeoMxSet" ))
}
## rest of code
}
Dude(Data = data, Norm = "neg")