Budget_Import_Constraint | R Documentation |
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)
Budget_Import_Constraint(Address, Sheet= "Budget", Limit= NULL,
Silence= FALSE, Env= .GlobalEnv)
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 |
Silence |
A binary parameter: if |
Env |
the environment where the package should create or access variables. By default the package works in the R's Global environment. (Default: .GlobalEnv) |
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)
NULL (creates some variables in the environment but returns nothing)
Other Budget Constraints:
Budget_Add_Constraint()
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.