diff --git a/DESCRIPTION b/DESCRIPTION index b7a1ea6..433d8e2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", , "matthew.james.henderson@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-7949-8208")) diff --git a/NAMESPACE b/NAMESPACE index 9f5d919..1acb1ee 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,3 +2,4 @@ export(add_cols) export(add_rows) +export(first_row_natural) diff --git a/R/first-row.R b/R/first-row.R new file mode 100644 index 0000000..52e403d --- /dev/null +++ b/R/first-row.R @@ -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) +} \ No newline at end of file diff --git a/man/first_row_natural.Rd b/man/first_row_natural.Rd new file mode 100644 index 0000000..e01f5da --- /dev/null +++ b/man/first_row_natural.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/first-row.R +\name{first_row_natural} +\alias{first_row_natural} +\title{First row in in natural order} +\usage{ +first_row_natural(n) +} +\arguments{ +\item{n}{Number of columns} +} +\value{ +A 1 x n latin rectangle with first row 1,...,n +} +\description{ +First row in in natural order +}