Skip to content

Commit

Permalink
r1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MMunozMarquez committed Feb 21, 2023
1 parent 853893f commit 5ccd258
Show file tree
Hide file tree
Showing 19 changed files with 263 additions and 43 deletions.
4 changes: 4 additions & 0 deletions pkg/adea/.Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
^makefile$
^adea\.Rcheck$
^doc$
^Meta$
3 changes: 3 additions & 0 deletions pkg/adea/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 1.3.1
2022-02-09
* Add a new plot of virtual input vs virtual outpur for an adea object
Version 1.2.1
2021-12-13
* Add test with testhat package
Expand Down
25 changes: 13 additions & 12 deletions pkg/adea/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
Package: adea
Type: Package
Depends: Benchmarking, combinat, lpSolveAPI, methods, R (>= 3.5.0),
rmarkdown
Imports: knitr
Depends:
Benchmarking,
combinat,
lpSolveAPI,
methods,
R (>= 3.5.0),
rmarkdown
Imports:
knitr
VignetteBuilder: knitr
Version: 1.2.1
Date: 2021-12-13
Version: 1.3.1
Date: 2022-02-09
ByteCompile: true
Title: Alternate DEA Package
Authors@R: c(person('Fernando', 'Fernandez-Palacin', email = '[email protected]', role = 'aut', comment = c(ORCID='0000-0002-3525-2924')), person('Manuel', 'Munoz-Marquez', email = '[email protected]', role = c('aut', 'cre'), comment = c(ORCID = '0000-0003-4157-8784')))
Expand All @@ -15,12 +21,7 @@ Description: The meaning of adea is "alternate DEA". This package is devoted to
<https://knuth.uca.es/shiny/DEA/>.
License: GPL (>= 3)
RoxygenNote: 7.1.2
Suggests: testthat (>= 3.0.0)
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
Config/testthat/parallel: true
NeedsCompilation: no
Packaged: 2021-12-13 18:05:30 UTC; mmarquez
Author: Fernando Fernandez-Palacin [aut]
(<https://orcid.org/0000-0002-3525-2924>),
Manuel Munoz-Marquez [aut, cre]
(<https://orcid.org/0000-0003-4157-8784>)
3 changes: 3 additions & 0 deletions pkg/adea/NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(plot,adea)
S3method(print,adea)
S3method(print,adeahierarchical)
S3method(print,adealoadleverage)
Expand All @@ -26,7 +27,9 @@ import(rmarkdown)
import(stats)
importFrom(combinat,combn)
importFrom(combinat,permn)
importFrom(graphics,abline)
importFrom(graphics,lines)
importFrom(graphics,plot)
importFrom(graphics,text)
importFrom(stats,na.omit)
importFrom(stats,sd)
23 changes: 19 additions & 4 deletions pkg/adea/R/adea-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#'
#' Package: adea
#'
#' Version: 1.2.1
#' Version: 1.3.1
#'
#' Date: 2021-12-13
#' Date: 2022-02-09
#'
#' License: GPL (>= 3)
#' }
Expand Down Expand Up @@ -65,9 +65,24 @@
#'
#' @keywords package DEA
#'
#' @references Stepwise Selection of Variables in DEA Using Contribution Load. \emph{F. Fernandez-Palacin}, \emph{M. A. Lopez-Sanchez} and \emph{M. Munoz-Marquez}. Pesquisa Operacional 38 (1), pg. 1-24, 2018. <DOI:10.1590/0101-7438.2018.038.01.0000>.
#' @references Methodology for calculating critical values of relevance measures in variable selection methods in data envelopment analysis. \emph{Jeyms Villanueva-Cantillo} and \emph{Manuel Munoz-Marquez}. European Journal of Operational Research, 290 (2), pg. 657-670, 2021. <DOI:10.1016/j.ejor.2020.08.021>.
#' @references A new approach to the bi-dimensional representation of the DEA efficient frontier with multiple inputs and outputs.
#' \emph{Carlos A. Bana e Costa} and \emph{Joao Carlos C. B. Soares de Mello} and \emph{Lidia Angulo Meza}.
#' European Journal of Operational Research, 255 (1), pg. 175-186, 2016,
#' <DOI:10.1016/j.ejor.2016.05.012>.
#'
#' @references Stepwise Selection of Variables in DEA Using Contribution Load.
#' \emph{F. Fernandez-Palacin}, \emph{M. A. Lopez-Sanchez} and \emph{M. Munoz-Marquez}.
#' Pesquisa Operacional 38 (1), pg. 1-24, 2018.
#' <DOI:10.1590/0101-7438.2018.038.01.0000>.
#'
#' @references Methodology for calculating critical values of relevance measures in variable selection methods in data envelopment analysis.
#' \emph{Jeyms Villanueva-Cantillo} and \emph{Manuel Munoz-Marquez}.
#' European Journal of Operational Research, 290 (2), pg. 657-670, 2021.
#' <DOI:10.1016/j.ejor.2020.08.021>.
#'
#' @import Benchmarking
#' @importFrom graphics abline
#' @importFrom graphics text
#' @import knitr
#' @import lpSolveAPI
#' @import methods
Expand Down
14 changes: 14 additions & 0 deletions pkg/adea/R/adea.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#' \item lp: A pointer to the linear programming program of the model. Mainly for research purpose
#' \item iinput: A vector of index of inputs that almost reach the load level
#' \item ioutput: A vector of index of outputs that almost reach the load level
#' \item vinput: Standardized virtual input dividing by the sum of the weights, see [Costa2006] in \code{\link{adea-package}}.
#' \item voutput: Standardized virtual output dividing by the sum of the weights, see [Costa2006] in \code{\link{adea-package}}.
#' }
#' }
#' @seealso \code{\link{adea-package}}.
Expand Down Expand Up @@ -159,6 +161,18 @@ adea <- function(input, output, orientation = c('input', 'output'), load.orienta

## Number of efficiency units
.adea$neff <- sum((.dea$eff < 1 + eff.tolerance) & (.dea$eff > 1 - eff.tolerance))

## Store input and ouput
## .adea$input <- input
## .adea$output <- output

## Compute and store virtual input and output as described in @references A new approach to the bi-dimensional representation of the DEA efficient frontier with multiple inputs and outputs
if (orientation == 'output') s <- rowSums(.adea$vy)
if (orientation == 'input') s <- rowSums(.adea$ux)
ux <- .adea$ux/s
vy <- .adea$vy/s
.adea$vinput <- rowSums(ux * input)
.adea$voutput <- rowSums(vy * output)

## Change the class of the object
class(.adea) <- 'adea'
Expand Down
49 changes: 49 additions & 0 deletions pkg/adea/R/plot.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#' ADEA plot of standarized virtual input and virtual output
#'
#' @aliases plot plot,adea-method
#' @docType methods
#' @keywords DEA ADEA plot
#'
#' @param x ADEA object to be plotted
#' @param main if not null then it is used as main in plot.
#' Its default value is the translation of "ADEA efficient frontier".
#' If the adea x has name it is added to the previous value.
#' @param xlab if not null then it is used as xlab in plot.
#' Its default value is the translation of "Virtual input".
#' @param ylab if not null then it is used as ylab in plot.
#' Its default value is the translation of "Virtual output".
#' @param labels if not null then a vector of labels for the DMUs points
#' @param labels.pos position for the labels in the plot. Its default value is 4.
#' @param lcol the color to use to draw the line.
#' Its default value is black.
#' @param ... Adittional parameters to plot
#' @return A list with vinput and voutput values.
#' These values are provided mainly for use with the function identify.
#'
#' @details
#' This function plots virtual input and virtual outpus in an ADEA model.
#' The virtual input and output vectors are computed as a weighted sum of the inputs and outputs.
#' In addition, it is imposed that the sum of the weights be the unit.
#'
#' For more information on this calculation process see the references in \cite{adea-package}.
#'
#' For the calculations of virtual input and virtual output, the weights generated by ADEA have been used, but they are the same as those that would be obtained using standard DEA.
#'
#' @examples
#' data("cardealers4")
#' input = cardealers4[, c('Employees', 'Depreciation')]
#' output = cardealers4[, c('CarsSold', 'WorkOrders')]
#' adea <- adea(input = input, output = output)
#' plot(adea)
#' @seealso \code{\link{adea}}
#' @export
plot.adea <- function(x, main = NULL, xlab = NULL, ylab= NULL, labels = NULL, labels.pos = 4, lcol = "black", ...) {
if (is.null(main)) main <- gettext("ADEA efficient frontier")
if (x$name != "") main <- paste(main, gettext("for model:"), x$name)
if (is.null(xlab)) xlab <- gettext("Virtual input")
if (is.null(ylab)) ylab <- gettext("Virtual output")
plot(x$vinput, x$voutput, main = main, xlab = xlab, ylab = ylab, ...)
abline(a = 0, b = 1, col = lcol)
if (!is.null(labels)) text(x$vinput, x$voutput, labels = labels, pos = labels.pos)
invisible(list(vinput = x$vinput, voutput = x$voutput))
}
Binary file modified pkg/adea/build/vignette.rds
Binary file not shown.
4 changes: 2 additions & 2 deletions pkg/adea/inst/doc/adea_load_leverage.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<meta name="author" content="Fernando Fernandez-Palacin" />
<meta name="author" content="Manuel Munoz-Marquez" />

<meta name="date" content="2021-12-13" />
<meta name="date" content="2022-02-09" />

<title>Influential or leverage units in ADEA</title>

Expand Down Expand Up @@ -350,7 +350,7 @@
<h1 class="title toc-ignore">Influential or leverage units in ADEA</h1>
<h4 class="author">Fernando Fernandez-Palacin<a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a></h4>
<h4 class="author">Manuel Munoz-Marquez<a href="#fn2" class="footnote-ref" id="fnref2"><sup>2</sup></a></h4>
<h4 class="date">2021-12-13</h4>
<h4 class="date">2022-02-09</h4>



Expand Down
4 changes: 2 additions & 2 deletions pkg/adea/inst/doc/adea_variable_selection.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<meta name="author" content="Fernando Fernandez-Palacin" />
<meta name="author" content="Manuel Munoz-Marquez" />

<meta name="date" content="2021-12-13" />
<meta name="date" content="2022-02-09" />

<title>Variable selection in DEA with adea method</title>

Expand Down Expand Up @@ -350,7 +350,7 @@
<h1 class="title toc-ignore">Variable selection in DEA with adea method</h1>
<h4 class="author">Fernando Fernandez-Palacin<a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a></h4>
<h4 class="author">Manuel Munoz-Marquez<a href="#fn2" class="footnote-ref" id="fnref2"><sup>2</sup></a></h4>
<h4 class="date">2021-12-13</h4>
<h4 class="date">2022-02-09</h4>



Expand Down
4 changes: 2 additions & 2 deletions pkg/adea/inst/doc/cadea.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<meta name="author" content="Fernando Fernandez-Palacin" />
<meta name="author" content="Manuel Munoz-Marquez" />

<meta name="date" content="2021-12-13" />
<meta name="date" content="2022-02-09" />

<title>Constrained ADEA model</title>

Expand Down Expand Up @@ -350,7 +350,7 @@
<h1 class="title toc-ignore">Constrained ADEA model</h1>
<h4 class="author">Fernando Fernandez-Palacin<a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a></h4>
<h4 class="author">Manuel Munoz-Marquez<a href="#fn2" class="footnote-ref" id="fnref2"><sup>2</sup></a></h4>
<h4 class="date">2021-12-13</h4>
<h4 class="date">2022-02-09</h4>



Expand Down
Binary file modified pkg/adea/inst/po/es/LC_MESSAGES/R-adea.mo
Binary file not shown.
26 changes: 26 additions & 0 deletions pkg/adea/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package := adea
version := 1.3.1
R := $(wildcard R/*.R)
Rmd := $(wildcard vignettes/*.Rmd)
html := $(patsubst vignettes/%.Rmd,inst/doc/%.html,$(Rmd))

$(package).Rcheck: $(package)_$(version).tar.gz
R CMD check --as-cran $(package)_$(version).tar.gz
$(package)_$(version).tar.gz: $(R) $(Rmd) $(html) ChangeLog DESCRIPTION inst/po/es/LC_MESSAGES/R-$(package).mo po/R-$(package)-es.po po/R-$(package).pot
R -e "library('roxygen2'); roxygenize('.')"
R CMD build --no-build-vignettes .
R CMD INSTALL $(package)_$(version).tar.gz
inst/po/es/LC_MESSAGES/R-$(package).mo: po/R-$(package)-es.po
msgfmt -c -o inst/po/es/LC_MESSAGES/R-$(package).mo po/R-$(package)-es.po
po/R-$(package)-es.po: $(R) po/R-$(package).pot
poedit po/R-$(package)-es.po
po/R-$(package).pot: $(R)
# This target builds the pot file and update any R-$(package)-lang.po file under po dir
R -e "library('tools'); update_pkg_po('.')"
touch po/R-$(package).pot
inst/doc/%.html: $(R) $(Rmd)
make vignettes
vignettes: $(R) $(Rmd)
R -e "devtools::build_vignettes('.', clean = FALSE, install = FALSE)"
mv --force doc/* inst/doc/
rmdir doc
19 changes: 15 additions & 4 deletions pkg/adea/man/adea-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/adea/man/adea.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions pkg/adea/man/plot.adea.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/adea/po/R-adea-es.mo
Binary file not shown.
Loading

0 comments on commit 5ccd258

Please sign in to comment.