Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.0.0 release? #65

Closed
friendly opened this issue Sep 8, 2024 · 23 comments
Closed

V1.0.0 release? #65

friendly opened this issue Sep 8, 2024 · 23 comments

Comments

@friendly
Copy link
Owner

friendly commented Sep 8, 2024

With the near completion of our work on latexMatrix() and friends, I'm thinking it will soon be time to release this as v 1.0.0. To this end, I'll bump the current version to 0.9.95

What tasks remain?

  • Complete work on bordered matrices Bordering a matrix #63. I don't think we should take this further, eg., to propagate labels in matrix operations -- would get too messy.
  • Edit latex-equations.Rmd vignette to illustrate bordered matrices & preview feature
  • Why doesn't Eqn() pick up row/col labels? Bordering a matrix #63 (comment)

Feel free to add to this list

@john-d-fox
Copy link
Collaborator

With the changes I just pushed, I think I'm now finished with the bordering code. I have to move it into R/latexMatrix.R and document it, which I'll do soon.

I decided early-on not to propagate labels in matrix operations, but I'm not sure that's the right decision. I think that the rules should be reasonably clear, and it would be necessary to check for incompatible labels, which should be an error. Think, for example, of starting with a data matrix X with variables as column names and cases as row names. Something like t(X) %*% X would naturally have variable names for rows and columns. Similarly, cbind(A, B) would make sense only if A and B had the same row names. Maybe there are cases where dim names would be ambiguous but I don't immediately see that. Whether this is worth the effort is another question.

@john-d-fox
Copy link
Collaborator

I moved the matrix bordering code to R/latexMatrix.R and added documentation and a couple of examples.

@philchalmers
Copy link
Collaborator

@friendly I don't see what you mean with border matricies and Eqn. Here's what I get with the latest commit:

W <- latexMatrix(rownames=c("\\alpha_1", "\\alpha_2", "\\alpha_m"),
                 colnames=c("\\beta_1", "\\beta_2", "\\beta_n"))
W |> Eqn()

image

@friendly
Copy link
Owner Author

friendly commented Sep 8, 2024

Must be a holdover from an earlier version. I just wanted to make sure it was working.

@john-d-fox
Copy link
Collaborator

I think this relates to the point I made yesterday that the changes to print.latexMatrix() weren't yet in R/latexMatrix.R; they are now.

BTW, I figured out a way to make the adjustments to cell and column-name spacing more flexible by introducing new optional arguments to print.latexMatrix() that take their default values from a couple of new options(). I'll upload that to GitHub shortly.

@john-d-fox
Copy link
Collaborator

About propagating labels in matrix operations: I tried out matsum(), called by +, as a test case, and it was very simple to accommodate labels. See the new file dev/operations-with-names.R for code and examples. In particular, I only had to add the following lines to matsum.latexMatrix():

dimnames <- dimnames(A)
  for (M in matrices)   {
    matlib:::numericDimensions(M)
    if (!isTRUE(all.equal(dimnames, dimnames(M)))){
      stop("matrix dimension names don't match")
    }
  }

...

Dimnames(A) <- dimnames

Thoughts?

@friendly
Copy link
Owner Author

friendly commented Sep 9, 2024

That does look simple. Should be easy for most of the other operators also, perhaps except for kronecker().
That has a make.dimnames argument, for which the code in .kronecker is

    if (make.dimnames && !(is.null(dnx) && is.null(dny))) {
        if (is.null(dnx)) 
            dnx <- vector("list", length(dX))
        else if (ld < 0L) 
            dnx <- c(dnx, vector("list", -ld))
        tmp <- which(sapply(dnx, is.null))
        dnx[tmp] <- lapply(tmp, function(i) rep.int("", dX[i]))
        if (is.null(dny)) 
            dny <- vector("list", length(dY))
        else if (ld > 0) 
            dny <- c(dny, vector("list", ld))
        tmp <- which(sapply(dny, is.null))
        dny[tmp] <- lapply(tmp, function(i) rep.int("", dY[i]))
        k <- length(dim(opobj))
        dno <- vector("list", k)
        for (i in 1L:k) {
            tmp <- outer(dnx[[i]], dny[[i]], FUN = paste, sep = ":")
            dno[[i]] <- as.vector(t(tmp))
        }
        dimnames(opobj) <- dno
    }

@friendly
Copy link
Owner Author

friendly commented Sep 9, 2024

@philchalmers For Eqn(), does it make sense to have the default for preview be controllable by an option, so the default would be

preview = getOption("preview")

In running multiple tests, I found I wanted to turn preview off on some occasions.

@philchalmers
Copy link
Collaborator

Setting preview globally for testing purposes makes sense to me. I've added an option to do this though the slot is called 'previewEqn' to match the 'quartoEqn' form.

@john-d-fox
Copy link
Collaborator

I'm moving the discussion of dimnames and matrix operations to the issue "Bordering a matrix #63."

@friendly
Copy link
Owner Author

I'm not sure where we are on this issue, that of finishing our work to release a new version.

Is the bordermatrix topic done enough?

I did notice that our work on simplifying the matrix operators simplified the descriptions in the vignette, but please check this over to see if there is something I missed or something that could be added.

If we're nearly done, I can do the pre-release CRAN tests & preparation for submission

@john-d-fox
Copy link
Collaborator

I'm not sure where we are on this issue, that of finishing our work to release a new version.

Is the bordermatrix topic done enough?

That's in the issue "Bordering a matrix," which I think has run its course.

I did notice that our work on simplifying the matrix operators simplified the descriptions in the vignette, but please check this over to see if there is something I missed or something that could be added.

If we're nearly done, I can do the pre-release CRAN tests & preparation for submission

I don't have anything else planned.

@philchalmers
Copy link
Collaborator

I have some small features to add, some of which have appeared in earlier issues, but nothing pressing that would prevent a CRAN release. Agreed that border matrix is flexible enough for PDF/HTMLs now.

@friendly
Copy link
Owner Author

I've added dev/Prepare_for_CRAN.R, which provides more comprehensive pre-CRAN tests than I've used before.

One gotcha (@john-d-fox): What is the correct URL for this paper:

> urlchecker::url_check()
✖ Error: README.md:150:144 404: Not Found
* Fox & Friendly, [_Visualizing Simultaneous Linear Equations, Geometric Vectors, and Least-Squares Regression with the matlib Package for R_](https://socialsciences.mcmaster.ca/jfox/Papers/matlib-useR2016.pdf),

@john-d-fox
Copy link
Collaborator

McMaster retired the social-sciences web server. There is no current URL for this paper. I do, of course, have a local copy on my computer (and in various backups). It's not a paper, BTW, but some slides for a conference presentation.

@friendly
Copy link
Owner Author

OK, thx. I'll remove that link

@friendly
Copy link
Owner Author

All pre-CRAN checks have passed, so I think this is good to go. But I'll wait til next week, in case there are any last minute thoughts.

@friendly
Copy link
Owner Author

friendly commented Oct 2, 2024

Ran another devtools::check_win_devel() and other checks and all still OK. I'm going to release this now.

@friendly
Copy link
Owner Author

friendly commented Oct 5, 2024

I've added dev/Prepare_for_CRAN.R, which provides more comprehensive pre-CRAN tests than I've used before.

One gotcha (@john-d-fox): What is the correct URL for this paper:

> urlchecker::url_check()
✖ Error: README.md:150:144 404: Not Found
* Fox & Friendly, [_Visualizing Simultaneous Linear Equations, Geometric Vectors, and Least-Squares Regression with the matlib Package for R_](https://socialsciences.mcmaster.ca/jfox/Papers/matlib-useR2016.pdf),

I found this paper at: https://facsocsci.mcmaster.ca/jfox/Papers/matlib-useR2016.pdf
Is this where your stuff now is?

@john-d-fox
Copy link
Collaborator

I see that instead of removing the link to the presentation on the package, it was changed to https://facsocsci.mcmaster.ca/jfox/Papers/matlib-useR2016.pdf. I understand that McMaster intends to remove that website. It would be safer to copy the PDF to the GitHub archive and link it there.

@friendly
Copy link
Owner Author

friendly commented Oct 6, 2024

OK, safer that way. I'll do that.
BTW: There were some very nice examples there!

@friendly
Copy link
Owner Author

friendly commented Oct 7, 2024

Added papers/matlib-useR-2016.pdf to avoid bad URL

@friendly
Copy link
Owner Author

DONE!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants