Skip to content

Commit

Permalink
Add a function to create a first row in natural order.
Browse files Browse the repository at this point in the history
  • Loading branch information
MHenderson committed May 29, 2024
1 parent 9c5fac0 commit 10178d9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: keedwell
Title: Latin Squares in R
Version: 0.1.1.9002
Version: 0.1.1.9003
Authors@R:
person("Matthew", "Henderson", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-7949-8208"))
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

export(add_cols)
export(add_rows)
export(first_row_natural)
10 changes: 10 additions & 0 deletions R/first-row.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#' First row in in natural order
#'
#' @param n Number of columns
#'
#' @return A 1 x n latin rectangle with first row 1,...,n
#' @export
first_row_natural <- function(n) {
tidyr::expand_grid(row = 1:1, column = 1:n) |>
dplyr::mutate(symbol = 1:n)
}
17 changes: 17 additions & 0 deletions man/first_row_natural.Rd

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

0 comments on commit 10178d9

Please sign in to comment.