gaynorr / AlphaSimR

R package for breeding program simulations
https://gaynorr.github.io/AlphaSimR/
Other
42 stars 18 forks source link

Add name slot to population class? #59

Closed gregorgorjanc closed 2 years ago

gregorgorjanc commented 2 years ago

I am working on a simulation where storing a population name would come very handy. This made me think that in fact this would likely be useful in other places as well. Any pros or cons on adding a slot name to the population class? It could be empty most of the time.

JanezJ2 commented 2 years ago

One way to do this is via deparse(substitute(pop)) - got it from Ivan!

poca87 commented 2 years ago

Not critical, but just to be fair. I don't think this is from me...

gaynorr commented 2 years ago

I don't see enough value in this relative to the challenge of implementing it.

It probably makes the most sense to stick with the normal way of thinking of the population's name as being the name of the object. As shown by @JanezJ2 above, you can access this name within a function call.