Import_data: Import problem's data from Excel file

Description Usage Arguments Details Value See Also Examples

View source: R/Import_data.R

Description

Import_data imports the problem's data from an excel file. The excel file must include a sheet named "Parcels" providing names of all parcels in the problem and their status.
If any of the sheets named "First_Objective", "Second_Objective", "Sigma", and "Correlation" exist in the excel file, the function will automatically import the data from them.
Note: The sheets in the excel file must follow the structures explained in the functions in See Also section.

Usage

1
2
Import_data(Address, First_Objective_Sense= "Min",
                   Second_Objective_Sense="Min", Silence= FALSE, Env= .GlobalEnv)

Arguments

Address

A string: the location and name of the excel file.

First_Objective_Sense

A string: "Min" means the objective is to be minimized and "Max" means the objective is to be maximized. (Default: "Min")

Second_Objective_Sense

A string: "Min" means the objective is to be minimized and "Max" means the objective is to be maximized. (Default: "Min")

Silence

A binary parameter: if FALSE, the function will report a summary message. If TRUE, the function will be silent. (Default: FALSE)

Env

the environment where the package should create or access variables. By default the package works in the R's Global environment. (Default: .GlobalEnv)

Details

Based on the sheets available, Import_data will automatically call different functions.

If "Parcels" exists, the function Parcels_Import will be called. It will create variables Parcels representing the name of parcels and the order they are used, and Status showing which parcel is or is not protected (owned).
(For more information refer to function Parcels_Import)

If "First_Objective" exists, the function First_Objective_Import will be called, which will create a list named First_Objective. First_Objective[["Coefficients"]] stores the the coefficient of parcels and First_Objective[["Sense"]] stores the parameter First_Objective_Sense showing if the objective is to be minimized or maximized.
(For more information refer to function First_Objective_Import)

If "Second_Objective" exists, the function Second_Objective_Import will be called, which will create a list named Second_Objective. Second_Objective[["Coefficients"]] stores the the coefficient of parcels and Second_Objective[["Sense"]] stores parameter Second_Objective_Sense showing if the objective is to be minimized or maximized.
(For more information refer to function Second_Objective_Import)

If both "Sigma" and "Correlation" exist, the function Risk_Objective_Import will be called. It will creat a list named Risk_Objective will be created, where Risk_Objective[["Sigma"]] stores the the sigmas of parcels, Risk_Objective[["Correlation"]] stores the the Correlation of parcels.
(For more information refer to function Risk_Objective_Import)

Value

NULL (creates some variables in the environment but returns nothing)

See Also

Other Import Functions: First_Objective_Import(), Parcels_Import(), Risk_Objective_Import(), Second_Objective_Import()

Examples

1
2
3
4
5
6
## Not run: 

Import_data(Address= "C:\\Folder\\example.xlsx",
            First_Objective_Sense= "Max", Second_Objective_Sense="Max")

## End(Not run)

paymanghasemi/SiteOpt documentation built on April 8, 2021, 3:44 a.m.