Budget_Import_Constraint: Import Budget Constraint's data from Excel file

Description Usage Arguments Details Value See Also Examples

View source: R/Budget.R

Description

Budget_Import_Constraint imports the Budget Constraint's data from a sheet in an excel file. Everytime used, it will add a member to a list named Budget which will store the budget constraints.
(For more information, refer to Budget_Add_Constraint)

Usage

1
2
Budget_Import_Constraint(Address, Sheet= "Budget", Limit= NULL,
                                Silence= FALSE, Env= .GlobalEnv)

Arguments

Address

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

Sheet

A string: the name of the sheet holding the budget constraint data. (Default: "Budget")

Limit

A double: defining the budget limit (right-hand-side). If NULL, the Limit will be read from the excel file. (Default: NULL)

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

The first row of the sheet will be ignored as captions. The first column of the sheet should have names of parcels in the constraint, and the second column should have the parcels' respective coefficients. The Budget Limit can be passed as a Parameter when calling the Budget_Import_Constraint, for instance Limit= 50. Otherwise, if Limit = NULL, the function will look for a row named "Limit" in the input sheet and use its value as the constraints limit.
Here is an example Budget constraint table:


Removing a budget: Budget i can be removed using the following code:

Budget[[i]]<-NULL

Removing all budget constraints: All budget constraints can be removed using the following code:

remove(Budget)

Value

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

See Also

Other Budget Constraints: Budget_Add_Constraint()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

## To read the data and import the budget limit from the excel file ##

Budget_Import_Constraint("C:\\example.xlsx", Sheet= "Budget", Limit= NULL)

## To read the data from excel file, and put the Budget limit equal to 60.
(It will ignore the limit defined in the excel file) ##

Budget_Import_Constraint("C:\\example.xlsx", Sheet= "Budget", Limit= 60)


## End(Not run)

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