-
Notifications
You must be signed in to change notification settings - Fork 10
Description
I was recently running a simulation with a model, with just one subject in the simulation data file, and tried to do a PTA analysis, only for the code to return the following code and error:
NeoFloSimPTA<-NeoFlo$sim(data=NeoFloData,nsim=1000,limits=NA)
NeoFloPTA<-NeoFloSimPTA$pta(targets=c(0.125,0.25,0.5,1,2,4,8,16,32),target.type="time",
success=0.4,start=0, end=24, outeq=1)
Error in simdata[[1]] : wrong arguments for subsetting an environment
The issue is the PM_Sim environment creates a list of entries [1], [2] etc. in the environment folder amt when you simulate with multiple individuals, which are called by the pta function. However, if you simulate with just one individual, the simulation data is just within amt (without being in a [1] folder) and therefore cannot be called by the pta function.
I've worked around it by having a dummy second individual, but just reporting to highlight the bug.