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 area_table.
1 2 3 4 5 6 7 | prepare_area(
csv,
data = NULL,
output_file = NULL,
sep = "[,\t\r\n |;:]+",
seed = NULL
)
|
csv |
File path of an input csv file. See the Detail section to know about form of input csv. |
data |
data.frame as a input instead of |
output_file |
The name of an output file (must be a csv file). If |
sep |
Separatator used in |
seed |
Seed for a simulation. |
An input csv file can have following columns. The csv file must contain area_type
column.
area_id
: If not set or non-numerical value is set, sequencial integers are allocated (from 1 to the number of input rows). More than two rows can have the same area_id
only when these rows have area_type
s as "tie". e.g. data.frame(area_id = c(1, 1), area_type = c("tie", "tie"), capacity = c(10, 20))
is identical to data.frame(area_id = 1, area_type = "tie", capacity = list(c(10, 20)))
. If NA
, the previous non-NA
value is set.
area_type
capacity
: If NA
, Inf
is set. If area_type
is "tie" or "hatch", capacity
must be set. A character like "10,20,30x2"
will be converted to a numeric vector c(10, 20, 30, 30)
. Separator (,
) can be specifed by sep
argument.
For further detail of each variable, see area_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.