mmellis / rSPACE

Power analysis for occupancy-based monitoring
7 stars 1 forks source link

Can't find the parameters key #26

Closed technoautotroph closed 6 years ago

technoautotroph commented 8 years ago

Hello,

I have run a number of simulations and everything has gone smooth. The following code was used:

BParS <- enter.parameters()
Scenario9 <- BParS
Scenario9$detP_test <- 0.3  #Reduce detection probability
Scenario9 

Output:

$N [1] 150; $lmda [1] 0.933; $n_yrs [1] 10; $MFratio [1] 0.6 0.4; $buffer [1] 0.12 0.17; $moveDist [1] 0.2 0.2; $moveDistQ [1] 0.7 0.9;

$maxDistQ [1] 0.95 0.95; $grid_size [1] 0.0014; $habitat.cutoff [1] 0.75; $sample.cutoff [1] 0.5; $n_visits [1] 3; $detP_test [1] 0.3

S9EMaps <- encounter.history(map=AMapS, Parameters=Scenario9, showSteps=T) >createReplicates(n_runs=11, map=AMapS, Parameters=Scenario9, run.label='rSPACE.Scenario9', add=T)

The replicates were created and look fine.

>testReplicates(folder=".../rSPACE/rSPACE.Scenario9", Parameters=Scenario9, overwrite=T)

Output

rSPACE creates text files. If you're ok with this, press ENTER to continue. Typing anything else will exit.

Setting up... 1 ................................ 2 ................................ 3 ................................ 4 ................................ 5 ................................ 6 ................................ 7 ................................ 8 ................................ 9 ................................ 10 ................................ 11 ................................ elapsed 274.56

>getResults(folder=".../rSPACE/rSPACE.Scenario9", CI = 0.95, returnData = 1, plot=T)

Output:

Error in getData(folder, CI) : Can't find the parameters key

Why would I be getting the final error message? The same error come up with findPower.

mmellis commented 8 years ago

Hi Mark - It's important to maintain the correct set of parameters throughout working on a scenario. We've built in some features to save and check to make sure that the parameters used are the same one as were used to create the scenario. By default, createReplicates() should save an rdata file into your output folder for the scenario (labelled Parameters.rdata); however, if this file is not present you can create it by using the command: save(Scenario9, file='Parameters.rdata') #Scenario9 is the name for the parameter list in your example above The Parameters.rdata file can be anywhere in the scenario folder, but easiest to keep in the output folder. I will double check that the saveParameters option defaults to TRUE in createReplicates()