[FLR-list] Problems with fwd()

Luis Ridao luridao at gmail.com
Thu Mar 22 12:33:39 CET 2012


thanks Laurie ... the problem now is this line:

print("OK to here3")
ctrl<-fwdControl(data.frame(year=yr.TAC,max=c(NA,2),val=c(mean(TAC),NA),
quantity=c("catch","f")))

Year =2011
[1] "OK to here1"
[1] "OK to here2"
=== mean TAC 32935.08
[1] "OK to here3"
Error in `[<-`(`*tmp*`, 1, ac(min(ctrl at target[, "year"])), value = NA) :
  error in evaluating the argument 'j' in selecting a method for function
'[<-': Error in Summary.factor(c(1L, 1L), na.rm = FALSE) :
  min not meaningful for factors

Sorry for the inconvenience

Best,
Luis


On Wed, Mar 21, 2012 at 5:06 PM, Laurie <lauriekell at googlemail.com> wrote:

>  This is wrong
>
> target
> Target
>   year quantity min       val   max
> 1 2011        f  NA 0.4550558    NA
> 2 2012        f  NA 0.3200000    NA
> 3 2012    catch   0        NA 40000
> 4 2012        f  NA 2.0000000    NA
>
>
>     min         val         max
>   1          NA     0.45506          NA
>   2          NA     0.32000          NA
>   3     0.00000          NA 40000.00000
>   4          NA          NA     2.00000
>
>
> Try this! I have added an argument to fwd maxF that sets the upper bound on F
>
> print("OK to here1")
>       ## project MP to TAC year with the HCR and geom mean recr.
>       c.=fwdControl(data.frame(val=c(rep(0.2,2),NA),min=c(NA,NA,0),max=c(NA,NA,40000),year=c(2011:2012,2012),quantity=c(rep("f",2),"catch")))
>       MP<-fwd(MP,ctrl=c.,sr=list(model="mean",params=FLPar(1)),sr.residuals=SRrs,maxF=2)  ## HERE IS THE PROBLEM
>   print("OK to here2")
>
>
>
> Laureie
>
> On 03/21/2012 05:15 PM, Luis Ridao wrote:
>
> here it comes ... sorry about it
>
>  best,
> Luis
>
> On Wed, Mar 21, 2012 at 4:11 PM, Laurie <lauriekell at googlemail.com> wrote:
>
>>  There is no funcs.R file
>>
>> Laurie
>>
>>
>> On 03/20/2012 01:09 PM, Luis Ridao wrote:
>>
>>
>>  I have attached the input files and the script (the workspace is too
>> large >60 MB)
>>
>>
>>  Best,
>> Luis
>>
>> On Tue, Mar 20, 2012 at 11:57 AM, Laurie <lauriekell at googlemail.com>wrote:
>>
>>>  Send me the objects and code and I will try and run it.
>>>
>>> Laurie
>>>
>>>
>>> On 03/20/2012 12:21 PM, Luis Ridao wrote:
>>>
>>>  FLR-help,
>>>
>>>  I'm having problems with a MSE.
>>> I copy-paste the line which gives the error:
>>>
>>>  ...
>>> ...
>>>      * print("OK to here1")*
>>> *      ## project MP to TAC year with the HCR and geom mean recr.*
>>> *
>>> MP<-fwd(MP,ctrl=target,sr=list(model="mean",params=FLPar(1)),sr.residuals=SRrs)
>>> *
>>>  ...
>>>  ...
>>>
>>>  Year =2011
>>> [1] "OK to here1"
>>> *Error in .local(object, ctrl, ...) : 6*
>>>
>>>
>>>  My target is :
>>>  > *target*
>>>
>>>  Target
>>>   year min       val   max quantity season area unit spp fleet metier
>>> rel.year
>>> 1 2011  NA 0.4550558    NA        f     NA   NA   NA  NA    NA     NA
>>>     NA
>>> 2 2012  NA 0.3200000    NA        f     NA   NA   NA  NA    NA     NA
>>>     NA
>>> 3 2012   0        NA 40000    catch     NA   NA   NA  NA    NA     NA
>>>     NA
>>> 4 2012  NA 2.0000000    NA        f     NA   NA   NA  NA    NA     NA
>>>     NA
>>>   rel.season rel.area rel.unit
>>>  1         NA       NA       NA
>>> 2         NA       NA       NA
>>> 3         NA       NA       NA
>>> 4         NA       NA       NA
>>>
>>>     min        val        max
>>>    1         NA 4.5506e-01         NA
>>>   2         NA 3.2000e-01         NA
>>>   3 0.0000e+00         NA 4.0000e+04
>>>   4         NA         NA 2.0000e+00
>>>
>>>  the '*sr*' object :
>>>
>>>  > list(model="mean",params=FLPar(1))
>>> $model
>>> [1] "mean"
>>>
>>>  $params
>>> An object of class "FLPar"
>>> params
>>> a
>>> 1
>>> units:  NA
>>>
>>>  and the Sr residuals:
>>>
>>>  > *SRrs*
>>> An object of class "FLQuant"
>>> iters:  1000
>>>
>>>  , , unit = unique, season = all, area = unique
>>>
>>>       year
>>> quant 2011     2012     2013
>>>   all 27355(0) 27355(0) 27355(0)
>>>
>>>  units:  NA
>>>
>>>  R version :               R.2.14.2
>>>  FLash Version:         2.5.0
>>>  FLAdvice Version:    1.0
>>>  FLXSA Version:       2.5
>>>  FLAssess Version:   2.5
>>>  FLCore Version:       2.5
>>>
>>>  Running on Ubuntu 10.04.04
>>>
>>>  Thanks in advance
>>>
>>>
>>>
>>>  _______________________________________________
>>> flr-list mailing listflr-list at flr-project.orghttps://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
>>>
>>>
>>>
>>> _______________________________________________
>>> flr-list mailing list
>>> flr-list at flr-project.org
>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
>>>
>>>
>>
>>
>> _______________________________________________
>> flr-list mailing listflr-list at flr-project.orghttps://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
>>
>>
>>
>> _______________________________________________
>> flr-list mailing list
>> flr-list at flr-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
>>
>>
>
>
> _______________________________________________
> flr-list mailing listflr-list at flr-project.orghttps://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
>
>
>
> _______________________________________________
> flr-list mailing list
> flr-list at flr-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20120322/d0611ac9/attachment.html>


More information about the flr-list mailing list