Doutoranda em Oceanografia IO-USP. Trabalho com pesca de peixes recifais no Banco dos Abrolhos, BA.
Ambas as propostas são objetivas, factíveis e de interesse para teu campo de estudo. Porém, eu não entendi como seria dado o VLOT no plano A. Já existe essa informação na literatura? Me parece que o plano B deveria ser um passo dentro do plano A, não? Outra coisa, no plano A o vetor LEN é dado pelo usuário, certo? Em caso positivo o vetor LEN também seria um argumento da função.
—- Carlos
Optei por unir as duas propostas e elaborar as funções VLOT e FRO. A função VLOT é utilizada dentro da função FRO, de modo que ambas são complementares. Foram elaboradas duas funções, com uma página de ajuda para cada.
Função 01
VLOT                    package:unknown                 R Documentation
Value of the optimum length 
Description:
     Calculates the optimal length of a fish specie. It is used in the "FRO" function 
to provide the optimum size of a fish in the fishing catches and to provide the megaspawners 
size of a particular specie. 
Usage:
      VLOT (x) 
Arguments:
    x    Data frame with five columns (age, mean weight, mean length, number of
         individuals, number of individuals* mean weight). The values are numeric and the
         colnames should be: "age", "meanwei","meanlen", "numbind", "mul". 
Details:
        Identifies the length at which the number of fish in a given age class multiplied by 
        the average individual weight is maximum 
Value:
        Return the optimum length 
Author(s):
        Marília Previero 
References:
        FROESE, R. Keep it simple: three indicators to deal with overfishing. 
        Fish and Fisheries, Oxford, v. 5, n.1, p. 86–91, 2004. 
See Also:
        [[FRO|link text]]
Examples:
age=seq(from=1, to=20)
meanwei=c(0.05, 0.1,  0.3,0.7,	0.1,2.26,2.38,3.2,3.6,4.2,4.9,5.4,5.5,6.2,6.5,6.9,7.3,7.9,8.3,8.9)
meanlen=seq(from=10, to=86, by=4)
numbind=c(2, 4, 14, 22, 24, 66, 88, 122, 133, 131, 144, 99, 98, 76, 55, 33, 18,11, 7, 3)
mul=c(0.10, 0.40 ,4.20,15.40,2.40, 149.16, 209.44 ,390.40, 478.80, 550.20, 705.60, 534.60,539.00 ,471.20 ,357.50 ,227.70, 131.40 , 86.90 , 58.10 , 26.7)
data=data.frame(cbind(age, meanwei, meanlen, numbind, mul))
data
VLOT(data)
     
VLOT<- function(x)# x é um data frame com cinco colunas: age, meanwei,meanlen, numbind, mul  
{
  ma=max(x$mul)# encontra o valor máximo da coluna "mul"
  Len=x[x$mul==ma,1]# encontra o valor de "meanlen" correspondente ao valor de "ma"
  return (Len)# retorna o valor de Len, que é o VLOT
}
Script: script_vlot.txt
Função 02
FRO                        package:unknown                     R Documentation
Fishery indicators of Froese (2004) 
Description:
       To a certain fish specie, calculates the percentage of mature individuals, 
       the percentage of optimum size individuals and the percentage of mega spawners in 
       fisheries catches.
 
Usage:
       FRO(x,i,L50) 
Arguments:
  x    Data frame with one column containing the lengths of the individuals. 
       The colname should be "len"
  i    Data frame with five columns (age, weight, average length, the number 
       of individuals, number of subjects * Average weight). The colnames should
       be: "age", "meanwei","meanlen", "numbind", "mul". 
  L50  Numeric. Average size of first maturation, available in the literature 
       for the studied specie. 
Details:
       Records the percentage of individuals in the sample that are larger than the 
       L50, the percentage of individuals whose lengths are in the range of 10% below
       to 10% above that the value of the optimal size. Records the percentage of 
       individuals in the sample that have size 10% or more than the value of the optimal
       size.
Value:
   
  mat : Percentage of individuals in the sample that are larger than its L50
  lot : Percentage of individuals in the sample with optimum size
  
  mgr : Percentage of megaspawners  individuals in the sample
    
Author(s):
    Marília Previero
 
References:
     FROESE, R. Keep it simple: three indicators to deal with overfishing. 
Fish and Fisheries, Oxford, v. 5, n.1, p. 86–91, 2004. 
See Also:
      [[VLOT]] 
Examples:
age=seq(from=1, to=20)
meanwei=c(0.05 , 0.1,  0.3,0.7,	0.1,2.26,2.38,3.2,3.6,4.2,4.9,5.4,5.5,6.2,6.5,6.9,7.3,7.9,8.3,8.9)
meanlen=seq(from=10, to=86, by=4)
numbind=c(2, 4, 14, 22, 24, 66, 88, 122, 133, 131, 144, 99, 98, 76, 55, 33, 18,11, 7, 3)
mul=c(0.10, 0.40 , 4.20,  15.40, 2.40, 149.16, 209.44 ,390.40, 478.80, 550.20, 705.60, 534.60,539.00 ,471.20 ,357.50 ,227.70, 131.40 , 86.90 , 58.10 , 26.7)
opt=data.frame(cbind(age, meanwei, meanlen, numbind, mul))
VLOT(opt)
len=rnorm(100,mean=18, sd=15)
le=data.frame(len)
FRO(le,opt,9) 
     
FRO<-function(x,t,L50)
{
  mat=100*(sum(x>L50))/length(x$len) #contabiliza a porcentagem de indivíduos na amostra que são maiores que o L50
  lot=100*(sum(sum(x<VLOT(t)*1.1) - sum(x<VLOT(t)*0.9)))/length(x$len) #o lot vai ser a porcentagem de indivíduos 
  que estão no intervalo de comprimentos 10% menor a 10% maior que o VLOT.
  mgr=100 *(sum(x>VLOT(t)*1.1))/length(x$len) # o mgr é a porcentagem de indivíduos na amostra que tem tamanho maior
  que 10% a mais do VLOT.
  res=list(mat=mat, lot=lot, mgr=mgr) # resulta os valores de mat, lot e mgr
  return(res)
}
Script : script_fro.txt