@ -22,6 +22,7 @@ Continuar planilha
Vou estudar o emacs calc, tentando elaborar uma planilha para evolução do
Vou utilizar os manuais on line <https://orgmode.org/manual/Field-and-range-formulas.html >
e <https://orgmode.org/org.html#Built_002din-Table-Editor >
@ -106,7 +107,7 @@ As tabelas de composição de rebanho serão calculadas automáticamente, com ba
| | % Bezerras -> novilhas | 0.4 | 0.4 | 0.4 | 0.4 | 0.4 | 0.4 | % S_Nascidos |
| ^ | | BA1 | BA2 | BA3 | BA4 | BA5 | BA6 | |
|---+------------------------+-------+-------+-------+-------+-------+--------+--------------|
| | Vacas a vender | 0 | 0 | 0 | 3 | 14 | 9 | |
| | Vacas a vender | 0 | 0 | 0 | 6 | 14 | 9 | |
| ^ | | VV1 | VV2 | VV3 | VV4 | VV5 | VV6 | |
| | Novilhas a vender | 0 | 0 | 0 | 0 | 7 | 8 | |
| ^ | | NV1 | NV2 | NV3 | NV4 | NV5 | NV6 | |
@ -141,13 +142,13 @@ Temos o seguinte:
|---+-----------------+---------+-----+--------+-------+-------+-----+---------|
| # | VACAS >24 | 20 | 0 | 0 | 0 | 20 | 0 | 20 |
| ^ | | EAV | TRV | COV | VEV | SAV | TCV | EFV |
| # | NOVILHAS 12<>24 | 5 | 0 | 2 | 0 | 7 | 0 | 7 |
| # | NOVILHAS 12<>24 | 5 | 0 | 2 | 0 | 7 | 7 | 0 |
| ^ | | EAN | TRN | CON | VEN | SAN | TCN | EFN |
| # | BEZERRAS <12 | 0 | 8 | 0 | 0 | 8 | 8 | 0 |
| ^ | | EAB | FRB | COB | VEB | SAB | TCB | EFB |
| # | Outros | | 0 | 0 | 0 | | 0 | 0 |
| ^ | | EAO | FRO | COO | VEO | SAO | TCO | EFO |
#+TBLFM : $EAV=remote(Tab0, $VE1)::$EFV=$SAV-$TCV::$SAV=$EAV+$TRV+$COV-$VEV::$TCN=remote(Tab0,$TN1 )::$VEV=remote(Tab0, $VV1):: $EAN=remote(Tab0, $NE1)::$TRN=remote(Tab0, $TN1)::$CON=remote(Tab0, $NC1)::$VEN=remote(Tab0, $NV1)::$SAN=$EAN+$TRN+$CON-$VEN::$EFN=$SAN-$TCN::$EAB=remote(Tab0, $TE1)::$FRB=$EFV*remote(Tab0, $BA1);%.0f::$SAB=$EAB+$FRB+$COB-$VEB::$TCB=$SAB::$EFB=$SAB-$TCB
#+TBLFM : $EAV=remote(Tab0, $VE1)::$EFV=$SAV-$TCV::$SAV=$EAV+$TRV+$COV-$VEV::$TCN=($EAN+$TRN+$CON-$VEV )::$VEV=remote(Tab0, $VV1):: $EAN=remote(Tab0, $NE1)::$TRN=remote(Tab0, $TN1)::$CON=remote(Tab0, $NC1)::$VEN=remote(Tab0, $NV1)::$SAN=$EAN+$TRN+$CON-$VEN::$EFN=$SAN-$TCN::$EAB=remote(Tab0, $TE1)::$FRB=$EFV*remote(Tab0, $BA1);%.0f::$SAB=$EAB+$FRB+$COB-$VEB::$TCB=$SAB::$EFB=$SAB-$TCB
Na tabela 4 consta o número de animais para cada categoria, com as ocorrencias do ano. No caso das vacas, não há alteração, visto que não há entradas, nem saídas, e o número inicial é o mesmo do final. No caso das novilhas, há movimentação, com a transferência interna de 5 (que passam de bezerras para novilhas), compra de 2, e transferência cedendo 5 para serem vacas no próximo ano. Assim, o ano inicia com 1 novilha, e termina com 3.
@ -159,11 +160,11 @@ Na tabela 4 consta o número de animais para cada categoria, com as ocorrencias
#+NAME : Tab3_2
| | CATEGORIA | EXTTANT | TIR | COMPRA | VENDA | SALDO | TIC | EXTTFIN |
|---+-----------------+---------+-----+--------+-------+-------+-----+---------|
| # | VACAS >24 | 20 | 0 | 0 | 0 | 20 | 0 | 20 |
| # | VACAS >24 | 20 | 7 | 0 | 0 | 27 | 0 | 27 |
| ^ | | EAV | TRV | COV | VEV | SAV | TCV | EFV |
| # | Novilhas 12<>24 | 7 | 8 | 0 | 0 | 15 | 15 | 0 |
| # | Novilhas 12<>24 | 0 | 8 | 0 | 0 | 8 | 8 | 0 |
| ^ | | EAN | TRN | CON | VEN | SAN | TCN | EFN |
| # | Bezerras <12 | 0 | 8 | 0 | 0 | 8 | 8 | 0 |
| # | Bezerras <12 | 0 | 11 | 0 | 0 | 11 | 11 | 0 |
| ^ | | EAB | FRB | COB | VEB | SAB | TCB | EFB |
| # | outros | 1 | | | | 1 | | 1 |
| ^ | | EAO | FRO | COO | VEO | SAO | TCO | EFO |
@ -178,9 +179,9 @@ Na tabela 3.3 podemos observar...
#+NAME : Tab3_3
| | CATEGORIA | EXTTANT | TIR | COMPRA | VENDA | SALDO | TIC | EXTTFIN |
|---+-----------------+---------+-----+--------+-------+-------+-----+---------|
| # | VACAS >24 | 20 | 15 | 0 | 0 | 35 | 0 | 35 |
| # | VACAS >24 | 27 | 8 | 0 | 0 | 35 | 0 | 35 |
| ^ | | EAV | TRV | COV | VEV | SAV | TCV | EFV |
| # | Novilhas 12<>24 | 0 | 8 | 0 | 0 | 8 | 8 | 0 |
| # | Novilhas 12<>24 | 0 | 11 | 0 | 0 | 11 | 11 | 0 |
| ^ | | EAN | TRN | CON | VEN | SAN | TCN | EFN |
| # | Bezerras <12 | 0 | 14 | 0 | 0 | 14 | 14 | 0 |
| ^ | | EAB | FRB | COB | VEB | SAB | TCB | EFB |
@ -196,7 +197,7 @@ Comentários sobre a tabela 6
#+NAME : Tab3_4
| | CATEGORIA | EXTTANT | TIR | COMPRA | VENDA | SALDO | TIC | EXTTFIN |
|---+-----------------+---------+-----+--------+-------+-------+-----+---------|
| # | VACAS >24 | 35 | 8 | 0 | 3 | 40 | 0 | 40 |
| # | VACAS >24 | 35 | 11 | 0 | 6 | 40 | 0 | 40 |
| ^ | | EAV | TRV | COV | VEV | SAV | TCV | EFV |
| # | Novilhas 12<>24 | 0 | 14 | 0 | 0 | 14 | 14 | 0 |
| ^ | | EAN | TRN | CON | VEN | SAN | TCN | EFN |
@ -268,11 +269,11 @@ Os dados da tabela abaixo resultam da estimativa de evolução de rebanho, de ac
|---+--------------------+------+------+------+------+------+------|
| # | Total entradas | 2 | 0 | 0 | 0 | 2 | 0 |
|---+--------------------+------+------+------+------+------+------|
| # | Vacas saídas | 0 | 0 | 0 | 3 | 14 | 9 |
| # | Vacas saídas | 0 | 0 | 0 | 6 | 14 | 9 |
| # | Novilhas saídas | 0 | 0 | 0 | 0 | 7 | 8 |
| # | Terneiras saídas | 0 | 0 | 0 | 0 | 0 | 0 |
|---+--------------------+------+------+------+------+------+------|
| # | Total saídas | 0 | 0 | 0 | 3 | 14 | 17 |
| # | Total saídas | 0 | 0 | 0 | 6 | 14 | 17 |
|---+--------------------+------+------+------+------+------+------|
| | | | | | | | |
#+TBLFM :@2$3=remote(Tab3_1, $COV)::@2$4=remote(Tab3_2, $COV)::@2$5=remote(Tab3_3, $COV)::@2$6=remote(Tab3_4, $COV)::@2$7=remote(Tab3_5, $COV)::@2$8=remote(Tab3_6, $COV)::@3$3=remote(Tab3_1, $CON)::@3$4=remote(Tab3_2, $CON)::@3$5=remote(Tab3_3, $CON)::@3$6=remote(Tab3_4, $CON)::@3$7=remote(Tab3_5, $CON)::@3$8=remote(Tab3_6, $CON)::@4$3=remote(Tab3_1, $COB)::@4$4=remote(Tab3_2, $COB)::@4$5=remote(Tab3_3, $COB)::@4$6=remote(Tab3_4, $COB)::@4$7=remote(Tab3_5, $COB)::@4$8=remote(Tab3_6, $COB)::@5$3=@2$3+@3$3+@4$3::@5$4=@2$4+@3$4+@4$4::@5$5=@2$5+@3$5+@4$5::@5$6=@2$6+@3$6+@4$6::@5$7=@2$7+@3$3+@4$7::@5$8=@2$8+@3$8+@4$8::@6$3=remote(Tab3_1, $VEV)::@6$4=remote(Tab3_2, $VEV)::@6$5=remote(Tab3_3, $VEV)::@6$6=remote(Tab3_4, $VEV)::@6$7=remote(Tab3_5, $VEV)::@6$8=remote(Tab3_6, $VEV)::@7$3=remote(Tab3_1, $VEN)::@7$4=remote(Tab3_2, $VEN)::@7$5=remote(Tab3_3, $VEN)::@7$6=remote(Tab3_4, $VEN)::@7$7=remote(Tab3_5, $VEN)::@7$8=remote(Tab3_6, $VEN)::@8$3=remote(Tab3_1, $VEB)::@8$4=remote(Tab3_2, $VEB)::@8$5=remote(Tab3_3, $VEB)::@8$6=remote(Tab3_4, $VEB)::@8$7=remote(Tab3_5, $VEB)::@8$8=remote(Tab3_6, $VEB)::@9$3=@6$3+@7$3+@8$3::@9$4=@6$4+@7$4+@8$4::@9$5=@6$5+@7$5+@8$5::@9$6=@6$6+@7$6+@8$6::@9$7=@6$7+@7$3+@8$7::@9$8=@6$8+@7$8+@8$8
@ -281,16 +282,16 @@ Os dados da tabela abaixo resultam da estimativa de evolução de rebanho, de ac
#+NAME :TABELA4
#+CAPTION : Resumo da evolução do rebanho (Animais existentes anualmente) nos primeiros anos do projeto
:PROPERTIES:
:TABLE_EXPORT_FILE: Documents /Tabela4.csv
:TABLE_EXPORT_FILE: data /Tabela4.csv
:TABLE_EXPORT_FORMAT: orgtbl-to-csv
:END:
| | Ano | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 |
|---+-----------+------+------+------+------+------+------|
| # | Vacas | 20 | 20 | 35 | 40 | 40 | 40 |
| # | Novilhas | 7 | 15 | 8 | 14 | 9 | 8 |
| # | Terneiras | 8 | 8 | 14 | 16 | 16 | 16 |
| # | Vacas | 20 | 27 | 35 | 40 | 40 | 40 |
| # | Novilhas | 7 | 8 | 11 | 14 | 9 | 8 |
| # | Terneiras | 8 | 11 | 14 | 16 | 16 | 16 |
|---+-----------+------+------+------+------+------+------|
| # | Total | 35 | 43 | 57 | 70 | 63 | 64 |
| # | Total | 35 | 46 | 60 | 70 | 63 | 64 |
| # | | | | | | | |
#+TBLFM :@2$3=remote(Tab3_1, $SAV)::@2$4=remote(Tab3_2, $SAV)::@2$5=remote(Tab3_3, $SAV)::@2$6=remote(Tab3_4, $SAV)::@2$7=remote(Tab3_5, $SAV)::@2$8=remote(Tab3_6, $SAV)::@3$3=remote(Tab3_1, $SAN)::@3$4=remote(Tab3_2, $SAN)::@3$5=remote(Tab3_3, $SAN)::@3$6=remote(Tab3_4, $SAN)::@3$7=remote(Tab3_5, $SAN)::@3$8=remote(Tab3_6, $SAN)::@4$3=remote(Tab3_1, $SAB)::@4$4=remote(Tab3_2, $SAB)::@4$5=remote(Tab3_3, $SAB)::@4$6=remote(Tab3_4, $SAB)::@4$7=remote(Tab3_5, $SAB)::@4$8=remote(Tab3_6, $SAB)::@5$3=@2$3+@3$3+@4$3::@5$4=@2$4+@3$4+@4$4::@5$5=@2$5+@3$5+@4$5::@5$6=@2$6+@3$6+@4$6::@5$7=@2$7+@3$3+@4$7::@5$8=@2$8+@3$8+@4$8
@ -305,6 +306,8 @@ library(dplyr)
library ( ggplot2 )
#+end_src
#+RESULTS :
#+begin_src R
Evol_exist <- fread ( " data/Tabela4.csv" , check.names = FALSE , header = TRUE )
str ( Evol_exist )
@ -321,6 +324,33 @@ library(dplyr)
#+end_src
#+RESULTS :
#+begin_ example
Classes ‘ data.table’ and 'data.frame': 5 obs. of 7 variables:
$ Ano : chr "Vacas" "Novilhas" "Terneiras" "Total" ...
$ 2004: int 20 7 8 35 NA
$ 2005: int 27 8 11 46 NA
$ 2006: int 35 11 14 60 NA
$ 2007: int 40 14 16 70 NA
$ 2008: int 40 9 16 63 NA
$ 2009: int 40 8 16 64 NA
- attr(*, ".internal.selfref")=<externalptr>
Classes ‘ data.table’ and 'data.frame': 6 obs. of 6 variables:
$ variable : Factor w/ 6 levels "2004","2005",..: 1 2 3 4 5 6
$ V1 : int NA NA NA NA NA NA
$ Novilhas : int 7 8 11 14 9 8
$ Terneiras: int 8 11 14 16 16 16
$ Total : int 35 46 60 70 63 64
$ Vacas : int 20 27 35 40 40 40
- attr(*, ".internal.selfref")=<externalptr>
- attr(*, "sorted")= chr "variable"
tibble [30 × 4] (S3: tbl_df/tbl/data.frame)
$ variable : Factor w/ 6 levels "2004","2005",..: 1 1 1 1 1 2 2 2 2 2 ...
$ Categoria: chr [1:30] "V1" "Novilhas" "Terneiras" "Total" ...
$ Cabecas : int [1:30] NA 7 8 35 20 NA 8 11 46 27 ...
$ Ano : Factor w/ 6 levels "2004","2005",..: 1 1 1 1 1 2 2 2 2 2 ...
#+end_example
*** Gráfico da evolução do rebanho
@ -342,9 +372,9 @@ plot(Evoluc)
#+end_src
#+RESULTS :
[[file:.. fig/Evol1.png ]]
[[file:~/ fig/Evoluc1 1.png ]]
**
* TODO - Resolver exportação figura no arquivo html