How can i transform getter values to data frame for example :
I have a simple class (person) and it has 2 objects (name and person),if i would like to get age values, i have to do run this simple instruction "person["age"]" and i get this result
An object of class "person"
Slot "val":
[1] 20 22 15 22 16
How can i transform it into data frame :
age
20
22
15
22
16
Thank you
this is dput result (forget about the other class ,person and human were just examples !)
new("Data"
, X = new("Signal"
, val = c(21, 22, 21, 22, 22, 24, 22, 23, 22, 22, 21)
)
, Y = new("Signal"
, val = c(11, 14, 13, 12, 12, 13, 12, 13, 14, 13, 13)
)
, Z = new("Signal"
, val = c(-130, -128, -129, -129, -129, -127, -128, -128, -128, -129,
-130)
)
)
this is setclass
.Signal.valid <- function(object){ return(TRUE)}
setClass (
Class ="Signal",
representation= representation(val="numeric"),
validity =.Signal.valid
)
rm (.Signal.valid )