I'm working on an R package to represent data stored in a file. I'm new to this type of coding as most of my R has been one-off scripts or some quick visualization. My background is more in heavy Object Oriented languages so while my examples reflect that I want to implement this in a way where "real" R programmers would see it and go "Oh, that makes sense."
I'd like to do something like the following pseudo-R:
o <- LoadMyFile("blah.data")
and then Access member elements in it:
file.version <- o.MajorVersion
some.data.series <- o.Experiments[42].RawValues
# Then I could plot some.data.series or do whatever I want
How would this work in R? I could imagine some kind of object being returned from LoadMyFile() and then other functions that operate on it:
o <- mylib.LoadMyFile("blah.data")
file.version <- mylib.MajorVersion(o)
some.data.series <- mylib.GetDataSeries(o, 42)