I'm working with an R program where I've dynamically created an S4 class. I would like to somehow loop through each of the variables in this class to write to a table.
classStructure <<- getColumns(jobClass)
myclass <- setClass("myclass", slots = classStructure)
method <<- setClassMethods()
setClassMethods <- function(){
setGeneric("myclass",
def = function(myclassVar, level, outFile){
standardGeneric("myclassMethod")
})
setMethod("myclassMethod", signature = "myclass",
function(myclassVar, level = classLevel, outFile = logFile){
# Stuff happens
# Loop through variables here
# Write table of class variables to file
}
}
Is this possible? Thanks for any help given.