From 272f142a02c77389982e6c0a95db2c7030ea8158 Mon Sep 17 00:00:00 2001 From: Walmes Zeviani <walmes@ufpr.br> Date: Mon, 21 Dec 2015 23:34:16 -0200 Subject: [PATCH] =?UTF-8?q?Fun=C3=A7=C3=A3o=20que=20depende=20da=20lattice?= =?UTF-8?q?,=20usa=20@importFrom.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aux/plotTriRet.R | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 aux/plotTriRet.R diff --git a/aux/plotTriRet.R b/aux/plotTriRet.R new file mode 100644 index 0000000..e16f25d --- /dev/null +++ b/aux/plotTriRet.R @@ -0,0 +1,28 @@ +#' @title Desenha um Triângulo Retângulo +#' @name plotTriRet +#' @export +#' +#' @description Exibe um triângulo retângulo a partir dos valores dos +#' catetos. +#' +#' @param a primeiro cateto. +#' @param b segundo cateto. +#' @param ... argumentos passados para a função +#' \code{\link[lattice]{xyplot}} +#' +#' @return Um grafico xyplot do pacote lattice. +#' +#' @seealso \code{\link[lattice]{xyplot}}. +#' +#' @importFrom lattice xyplot +#' +#' @examples +#' +#' plotTriRet(a=3, b=4) +#' +plotTriRet <- function(a, b, ...){ + x <- c(0, a, 0, 0) + y <- c(0, 0, b, 0) + xyplot(y ~ x, type = c("l", "g"), aspect = "iso", + xlab = NULL, ylab = NULL, col = 1, ...) +} -- GitLab