Skip to content

Commit

Permalink
fix vectors buglet; bump pkg vers.; add ORCIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
friendly committed Feb 10, 2024
1 parent e2f8650 commit 91cbe68
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
15 changes: 8 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ Package: matlib
Type: Package
Title: Matrix Functions for Teaching and Learning Linear Algebra and
Multivariate Statistics
Version: 0.9.7
Date: 2023-03-08
Authors@R: c(person(given = "Michael", family = "Friendly", role=c("aut", "cre"), email="[email protected]",
comment=c(ORCID="0000-0002-3237-0941")),
person(given = "John", family = "Fox", role="aut"),
person(given = "Phil", family = "Chalmers", role="aut"),
person(given = "Georges", family = "Monette", role="ctb"),
Version: 0.9.8
Date: 2024-02-10
Authors@R: c(person(given = "Michael", family = "Friendly",
role=c("aut", "cre"), email="[email protected]",
comment=c(ORCID="0000-0002-3237-0941")),
person(given = "John", family = "Fox", role="aut", comment = c(ORCID = "0000-0002-1196-8012")),
person(given = "Phil", family = "Chalmers", role="aut", comment = c(ORCID="0000-0001-5332-2810")),
person(given = "Georges", family = "Monette", role="ctb", comment = c(ORCID = "0000-0003-0076-5532")),
person(given = "Gaston", family = "Sanchez", role="ctb")
)
Maintainer: Michael Friendly <[email protected]>
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ import(stats)
importFrom(MASS,fractions)
importFrom(car,dataEllipse)
importFrom(grDevices,adjustcolor)
importFrom(grDevices,dev.cur)
importFrom(grDevices,rainbow)
importFrom(graphics,abline)
importFrom(graphics,arrows)
importFrom(graphics,lines)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,points)
importFrom(graphics,polygon)
importFrom(graphics,symbols)
importFrom(graphics,text)
importFrom(methods,is)
Expand Down
15 changes: 10 additions & 5 deletions R/circle.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@
#' Draw circles on an existing plot.
#'
#' @details
#' Rather than depending on the aspect ratio set in the call to \code{\link[base]{plot}},
#' \code{circle} uses the dimensions of the plot and the \code{x} and \code{y} coordinates to draw a circle rather than an ellipse.
#' Rather than depending on the aspect ratio \code{par("asp")} set globally or
#' in the call to \code{\link[base]{plot}},
#' \code{circle} uses the dimensions of the current plot and the \code{x} and \code{y} coordinates to draw a circle rather than an ellipse.
#' Of course, if you resize the plot the aspect ratio can change.
#'
#' This function was copied from
#' This function was copied from \code{\link[plotrix]{draw.circle}}
#'
#' @param x,y Coordinates of the center of the circle.
#' @param radius Radius (or radii) of the circle(s) in user units.
#' @param nv Number of vertices to draw the circle.
#' @param border Color to use for drawing the circumference.
#' @param border Color to use for drawing the circumference. \code{\link[graphics]{polygon}}
#' @param col Color to use for filling the circle.
#' @param lty Line type for the circumference.
#' @param density Density for patterned fill. See \code{\link[graphics]{polygon}}.
#' @param angle Angle of patterned fill. See \code{\link[graphics]{polygon}}.
#' @param lwd Line width for the circumference.
#'
#' @return Invisibly returns a list with the \code{x} and \code{y} coordinates of the points on the circumference of the last circle displayed.
#' @importFrom graphics polygon
#' @export
#' @seealso \code{\link[graphics]{polygon}}
#' @author Jim Lemon, thanks to David Winsemius for the density and angle args
Expand All @@ -31,6 +34,7 @@
#' # draw three concentric circles
#' circle(2, 4, c(1, 0.66, 0.33),border="purple",
#' col=c("#ff00ff","#ff77ff","#ffccff"),lty=1,lwd=1)
#' # draw some others
#' circle(2.5, 8, 0.6,border="red",lty=3,lwd=3)
#' circle(4, 3, 0.7,border="green",col="yellow",lty=1,
#' density=5,angle=30,lwd=10)
Expand Down Expand Up @@ -74,7 +78,8 @@ circle <- function(x, y,
#' \code{getYmult} retrieves the plot aspect ratio and the coordinate ratio for the current graphics device, calculates a
#' multiplicative factor to equalize the X and Y dimensions of a plotted graphic object.
#'
#'
#' @importFrom grDevices dev.cur
#' @importFrom graphics par
#' @return The correction factor for the Y dimension.
#' @author Jim Lemon
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/vectors.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ vectors <- function(X, origin=c(0,0),

if (is.vector(X)) X <- matrix(X, ncol=2)
vl <- len(t(X)) < 1e-4
ok <- !vl
if (any(vl)) {
ok <- !vl
warning("Row(s) ", paste(which(vl), collapse=', '), " are too small to draw and have been ignored.")
}
.arrows(origin[1], origin[2], X[ok,1], X[ok,2], lwd=lwd, length=length, angle=angle, ...)
Expand Down
11 changes: 7 additions & 4 deletions man/circle.Rd

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

0 comments on commit 91cbe68

Please sign in to comment.