I'd like to create a class in R that is like a data.frame but with fixed columns names.
For example this following data.frame could be the model of my class.
min max name_intervalles
1 0 10 Intervalle 1
I tried stuffs like this
setClass("interval2",contains="data.frame",slots=c(names=c("min","max","name_Intervalles")))
But it does not work.
Any idea ?
The goal is to check within a function if the input argument is correct to what expected. Checking if it's a data.frame is a too wide check. And checking the name of the columns seems not alright to me.
Thanks