Description Usage Arguments Details Value
View source: R/pre_simulation_process.R
Transform an input csv into a suitable form, which is in a form of cow_table.
1 2 3 4 5 6 7 8 9 10 11 |
csv |
File path of an input csv file. See the Detail section to know about form of input csv. |
param |
See param. |
data |
data.frame as a input instead of |
output_file |
The name of an output file (must be a csv file). If |
today |
A Date class object or a character in "YYYY/MM/DD" format. The date used to calculate |
create_calf_data |
logical or a numeric. Create data for young cows based on cow data in the input. Set this argument when the input does not contain data for young cows (e.g. when you use Nyuken data). If |
modify_prevalence |
One or two numbers within a range of 0 to 1. If the parameter is not |
area_name |
If |
seed |
Seed for a simulation. |
An input csv file can have following columns. The csv file must contain age
column.
cow_id
: It can be use-defined cow ID (not have to be a 9- or 10-digits code). If not set, cow_id
is allocated sequencially (From 1 to the number of input cows).
age
: Age in month. Either one of age
or date_birth
must be set.
date_birth
: Birth day. If age
is not set, age
is calculated from this and today
argument in the function.
sex
: One of "female", "male" or "freemartin". If not set, all cows are assumed to be "female".
is_replacement
: If a farm keeps non-replacement cows (e.g. a male newborn which will be send to a livestock market), set this parameter. If not set, age
= 0 female cows are assumed to be a replacement according to prop_replacement
parameter in param
and all male cows are assumed to be a non-replacement.
stage
, parity
, date_last_delivery
, date_got_pregnant
, date_dried
: If not set, they will be calculated in according to parameters related with reproduction in param.
is_to_test_pregnancy
: If not set, FALSE
is set.
n_ai
: If not set, it is assumed to be 0.
infection_status
: At least one of this variable or modify_prevalence
argument must be set. Valid categories are follows: "al", "pl" and "ebl" (case insensitive). Other values or NA
will be coerced to "s" (= non-infected). When modify_prevalence
is set, prevalence is modified to make prevalence equal to the first value of modify_prevalence
.
date_ial
, date_ipl
, date_ebl
: Specify the date when infection status was confirmed. If NULL
, 0
is set.
area_id
: If not set, cows are divided to four areas based on stage
("calf" = 1, "heifer" = 2, "milking" = 3, "dry" = 4). If NA
s are included, cows are allocated to areas in which cows with the same stage and parity are kept. If area_id
is written in character, argument area_name
must be set.
months_in_area
: If not set, it is assumed to be 0. This parameter has no effect when a farm does not use months_in_area
as a criteria for area movement. See area_table for detail of area movement.
chamber_id
: If not set, it is randomly allocated later in setup_cows()
.
is_isolated
: If not set, FALSE
is set.
For further detail of each variable, see cow_table.
A csv file which can be used as an input for simulate_blv_spread()
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.