diff --git a/.Rbuildignore b/.Rbuildignore index 538c330..0f61770 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,3 +4,8 @@ ^README\.Rmd$ ^cran-comments\.md$ .github +.lintr +^_pkgdown\.yml$ +^docs$ +^pkgdown$ +^\.github$ diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..bfc9f4d --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + release: + types: [published] + workflow_dispatch: + +name: pkgdown.yaml + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore index 5b6a065..234f028 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .Rhistory .RData .Ruserdata +docs diff --git a/.lintr b/.lintr new file mode 100644 index 0000000..4dc4717 --- /dev/null +++ b/.lintr @@ -0,0 +1,7 @@ +linters: linters_with_defaults( + line_length_linter = line_length_linter(160), + T_and_F_symbol_linter(), + assignment_linter(), + object_name_linter = NULL, + brace_linter = NULL + ) diff --git a/DESCRIPTION b/DESCRIPTION index 9962849..fd7de18 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: messy Title: Create messy data from clean dataframes -Version: 0.0.1 +Version: 0.0.2 Authors@R: c( person(given = "Nicola", family = "Rennie", role = c("aut", "cre", "cph"), email = "nrennie35@gmail.com", comment = c(ORCID = "0000-0003-4797-557X"))) @@ -20,4 +20,7 @@ Suggests: Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 +Config/Needs/website: nrennie/nrenniepkgdown +URL: https://nrennie.rbind.io/messy, https://github.com/nrennie/messy +BugReports: https://github.com/nrennie/messy/issues diff --git a/NAMESPACE b/NAMESPACE index 19d984b..2ab1d45 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,7 +1,9 @@ # Generated by roxygen2: do not edit by hand +export(add_special_chars) export(add_whitespace) export(change_case) export(make_missing) export(messy) +export(messy_colnames) importFrom(rlang,.data) diff --git a/NEWS.md b/NEWS.md index b9ccb9d..46c0b59 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# messy 0.0.2 + +* Add pkgdown site +* Add lintr file +* Add `messy_colnames()` function +* Add `messy_strings()` function + # messy 0.0.1 * Add `add_whitespaces()` function diff --git a/R/add_special_chars.R b/R/add_special_chars.R new file mode 100644 index 0000000..ebaf937 --- /dev/null +++ b/R/add_special_chars.R @@ -0,0 +1,86 @@ +#' Add special characters to strings + +#' @param data input dataframe +#' @param cols set of columns to apply transformation to. If `NULL` +#' will apply to all columns. Default `NULL`. +#' @param messiness Percentage of values to change. Must be +#' between 0 and 1. Default 0.1. +#' @importFrom rlang .data +#' @return a dataframe the same size as the input data. +#' @export +#' @examples +#' add_special_chars(mtcars) +add_special_chars <- function(data, + cols = NULL, + messiness = 0.1) { + if (messiness < 0 || messiness > 1) { + stop("'messiness' must be between 0 and 1") + } + if (is.null(cols)) { + output <- data |> + dplyr::mutate( + dplyr::across( + dplyr::where(~ is.character(.x) | is.factor(.x)), + ~ special_chars(.x, messiness = messiness) + ) + ) + } else { + # check if all cols present in colnames + if (!all((cols %in% colnames(data)))) { + stop("All elements of 'cols' must be a column name in 'data'") + } else { + output <- data |> + dplyr::mutate( + dplyr::across( + dplyr::all_of(cols) & + dplyr::where(~ is.character(.x) | is.factor(.x)), + ~ special_chars(.x, messiness = messiness) + ) + ) + } + } + return(output) +} + +#' Function to make a character string messy +#' +#' Adds special characters and randomly +#' capitalises strings. +#' @param x Character vector +#' @param messiness Percentage of values to change. Must be +#' between 0 and 1. Default 0.1. +#' @return Messy character vector +#' @noRd +special_chars <- function(x, messiness = 0.1) { + # if factor, convert to character + if (is.factor(x)) { + x <- as.character(x) + } + + special_chars_string <- function(s, ...) { + # characters to insert + random_chars <- c( + "!", "@", "#", "$", "%", "^", "&", + "*", "(", ")", "_", "+", "-", "." + ) + + # Convert to vector of characters + chars <- strsplit(s, NULL)[[1]] + + # Randomly insert special characters using lapply + chars <- Reduce(function(acc, char) { + if (stats::runif(1) < messiness) { + char_to_insert <- sample(random_chars, 1) + return(c(acc, char_to_insert, char)) + } else { + return(c(acc, char)) + } + }, chars, init = character(0)) + + # Reassemble the string + return(paste(chars, collapse = "")) + } + + x_messy <- sapply(x, special_chars_string, USE.NAMES = FALSE) + return(x_messy) +} diff --git a/R/add_whitespace.R b/R/add_whitespace.R index af5f32c..64b877c 100644 --- a/R/add_whitespace.R +++ b/R/add_whitespace.R @@ -9,6 +9,8 @@ #' between 0 and 1. Default 0.1. #' @return a dataframe the same size as the input data. #' @export +#' @examples +#' add_whitespace(mtcars) add_whitespace <- function(data, cols = NULL, messiness = 0.1) { if (messiness < 0 || messiness > 1) { diff --git a/R/change_case.R b/R/change_case.R index 0170186..2ddaaa2 100644 --- a/R/change_case.R +++ b/R/change_case.R @@ -1,51 +1,64 @@ #' Change case #' #' Randomly switch between title case and lowercase for +#' character strings #' @param data input dataframe #' @param cols set of columns to apply transformation to. If `NULL` #' will apply to all columns. Default `NULL`. #' @param messiness Percentage of values to change. Must be #' between 0 and 1. Default 0.1. +#' @param case_type Whether the case should change based on +#' the `"word"` or `"letter"`. #' @importFrom rlang .data #' @return a dataframe the same size as the input data. #' @export +#' @examples +#' change_case(mtcars) change_case <- function(data, cols = NULL, - messiness = 0.1) { + messiness = 0.1, + case_type = "word") { if (messiness < 0 || messiness > 1) { stop("'messiness' must be between 0 and 1") } - if (is.null(cols)) { - output <- data |> - dplyr::mutate( - rs_col = stats::runif(nrow(data)) - ) |> - dplyr::mutate( - dplyr::across( - dplyr::where(~ is.character(.x) | is.factor(.x)), - ~ dplyr::case_when( - .data$rs_col <= messiness / 2 ~ stringr::str_to_lower(.x), - (.data$rs_col > messiness / 2 & .data$rs_col <= messiness) ~ - stringr::str_to_upper(.x), - TRUE ~ .x + if (!(case_type %in% c("word", "letter"))) { + stop("'case_type' must be either 'word' or 'letter'") + } + + if (case_type == "letter") { + if (is.null(cols)) { + output <- data |> + dplyr::mutate( + dplyr::across( + dplyr::where(~ is.character(.x) | is.factor(.x)), + ~ change_letter_case(.x, messiness = messiness) ) ) - ) |> - dplyr::select(-.data$rs_col) - } else { - # check if all cols present in colnames - if (!all((cols %in% colnames(data)))) { - stop("All elements of 'cols' must be a column name in 'data'") } else { + # check if all cols present in colnames + if (!all((cols %in% colnames(data)))) { + stop("All elements of 'cols' must be a column name in 'data'") + } else { + output <- data |> + dplyr::mutate( + dplyr::across( + dplyr::all_of(cols) & + dplyr::where(~ is.character(.x) | is.factor(.x)), + ~ change_letter_case(.x, messiness = messiness) + ) + ) + } + } + } else { + if (is.null(cols)) { output <- data |> dplyr::mutate( rs_col = stats::runif(nrow(data)) ) |> dplyr::mutate( dplyr::across( - dplyr::all_of(cols) & - dplyr::where(~ is.character(.x) | is.factor(.x)), + dplyr::where(~ is.character(.x) | is.factor(.x)), ~ dplyr::case_when( .data$rs_col <= messiness / 2 ~ stringr::str_to_lower(.x), (.data$rs_col > messiness / 2 & .data$rs_col <= messiness) ~ @@ -55,7 +68,65 @@ change_case <- function(data, ) ) |> dplyr::select(-.data$rs_col) + } else { + # check if all cols present in colnames + if (!all((cols %in% colnames(data)))) { + stop("All elements of 'cols' must be a column name in 'data'") + } else { + output <- data |> + dplyr::mutate( + rs_col = stats::runif(nrow(data)) + ) |> + dplyr::mutate( + dplyr::across( + dplyr::all_of(cols) & + dplyr::where(~ is.character(.x) | is.factor(.x)), + ~ dplyr::case_when( + .data$rs_col <= messiness / 2 ~ stringr::str_to_lower(.x), + (.data$rs_col > messiness / 2 & .data$rs_col <= messiness) ~ + stringr::str_to_upper(.x), + TRUE ~ .x + ) + ) + ) |> + dplyr::select(-.data$rs_col) + } } } return(output) } + + +#' Function to change case of each individual letter +#' +#' @param x Character vector +#' @param messiness Percentage of values to change. Must be +#' between 0 and 1. Default 0.1. +#' @return Messy character vector +#' @noRd +change_letter_case <- function(x, messiness = 0.1) { + # if factor, convert to character + if (is.factor(x)) { + x <- as.character(x) + } + + change_letter_case_string <- function(s, ...) { + # Convert to vector of characters + chars <- strsplit(s, NULL)[[1]] + + # Randomly change the case of each character using sapply + chars <- sapply(chars, function(char) { + if (stats::runif(1) < messiness) { + return(toupper(char)) + } else { + return(tolower(char)) + } + }) + + # Reassemble the string + return(paste(chars, collapse = "")) + } + + x_messy <- sapply(x, change_letter_case_string, USE.NAMES = FALSE) + return(x_messy) +} diff --git a/R/globalVariables.R b/R/globalVariables.R new file mode 100644 index 0000000..8074801 --- /dev/null +++ b/R/globalVariables.R @@ -0,0 +1 @@ +utils::globalVariables(".data") diff --git a/R/make_missing.R b/R/make_missing.R index d8d4775..d860b5d 100644 --- a/R/make_missing.R +++ b/R/make_missing.R @@ -13,6 +13,8 @@ #' Default `NA`. #' @return a dataframe the same size as the input data. #' @export +#' @examples +#' make_missing(mtcars) make_missing <- function(data, cols = NULL, @@ -27,7 +29,7 @@ make_missing <- function(data, dplyr::across( dplyr::everything(), ~ dplyr::case_when( - runif(nrow(data)) <= messiness ~ unlist(sample(missing, 1)), + runif(nrow(data)) <= messiness ~ unlist(resample(missing, 1)), TRUE ~ .x ) ) @@ -42,7 +44,7 @@ make_missing <- function(data, dplyr::across( dplyr::all_of(cols), ~ dplyr::case_when( - runif(nrow(data)) <= messiness ~ unlist(sample(missing, 1)), + runif(nrow(data)) <= messiness ~ unlist(resample(missing, 1)), TRUE ~ .x ) ) diff --git a/R/messy.R b/R/messy.R index 38b838a..354e988 100644 --- a/R/messy.R +++ b/R/messy.R @@ -8,16 +8,21 @@ #' missing values will be replaced with. If length is greater #' than 1, values will be replaced randomly. #' Default `NA`. +#' @param case_type Whether the case should change based on +#' the `"word"` or `"letter"`. #' @return a dataframe the same size as the input data. #' @export - +#' @examples +#' messy(mtcars) messy <- function(data, messiness = 0.1, - missing = NA) { + missing = NA, + case_type = "word") { output <- data |> + add_special_chars(messiness = messiness) |> add_whitespace(messiness = messiness) |> make_missing(messiness = messiness, missing = missing) |> - change_case(messiness = messiness) + change_case(messiness = messiness, case_type = case_type) return(output) } diff --git a/R/messy_colnames.R b/R/messy_colnames.R new file mode 100644 index 0000000..84760a5 --- /dev/null +++ b/R/messy_colnames.R @@ -0,0 +1,22 @@ +#' Make column names messy +#' +#' Adds special characters and randomly +#' capitalises characters in the column +#' names of a data frame. +#' @param data data.frame to alter column names +#' @param messiness Percentage of values to change per function. Must be +#' between 0 and 1. Default 0.1. +#' @return data.frame with messy column names +#' @export +#' @examples +#' messy_colnames(mtcars) +messy_colnames <- function(data, messiness = 0.2) { + new_names <- data.frame(x = names(data)) |> + add_special_chars(messiness = messiness) |> + change_case(messiness = messiness) |> + add_whitespace(messiness = messiness) |> + dplyr::pull(.data$x) + # Assign the new column names to the dataframe + names(data) <- new_names + return(data) +} diff --git a/R/utils.R b/R/utils.R new file mode 100644 index 0000000..4b1e027 --- /dev/null +++ b/R/utils.R @@ -0,0 +1,7 @@ +#' Resample +#' +#' Resamples x of a specifc size +#' @param x either a vector of one or more elements from which to choose. +#' @return a vector of length size with elements drawn from either x +#' @noRd +resample <- function(x, ...) x[sample.int(length(x), ...)] diff --git a/README.md b/README.md index e2cb407..2a11706 100644 --- a/README.md +++ b/README.md @@ -24,17 +24,17 @@ messy(ToothGrowth[1:10,]) ``` ```r - len supp dose -1 4.2 vc 0.5 -2 11.5 VC 0.5 -3 7.3 VC 0.5 -4 5.8 VC 0.5 -5 6.4 VC 0.5 -6 10 VC 0.5 -7 11.2 VC 0.5 -8 11.2 VC 0.5 -9 5.2 VC 0.5 -10 7 + len supp dose +1 4.2 VC 0.5 +2 11.5 +3 7.3 VC 0.5 +4 5.8 (VC 0.5 +5 6.4 VC +6 10 VC 0.5 +7 11.2 0.5 +8 11.2 VC 0.5 +9 5.2 VC 0.5 +10 7 VC 0.5 ``` Increase how *messy* the data is: @@ -45,17 +45,17 @@ messy(ToothGrowth[1:10,], messiness = 0.7) ``` ```r - len supp dose -1 0.5 -2 -3 -4 -5 -6 10 0.5 -7 -8 0.5 -9 5.2 VC 0.5 -10 7 + len supp dose +1 +2 11.5 +3 +4 5.8 +5 .v*c +6 +7 +8 0.5 +9 v@c +10 ``` ### `add_whitespace()` @@ -125,6 +125,50 @@ change_case(ToothGrowth[1:10,], messiness = 0.5) 10 7.0 VC 0.5 ``` +By default, the case of the entire string is changes. Alternatively, you can specify to change the case of each individual letter: + +```r +set.seed(1234) +change_case(ToothGrowth[1:10,], messiness = 0.5, case_type = "letter") +``` + +```r + len supp dose +1 4.2 VC 0.5 +2 11.5 VC 0.5 +3 7.3 vC 0.5 +4 5.8 VC 0.5 +5 6.4 VC 0.5 +6 10.0 VC 0.5 +7 11.2 Vc 0.5 +8 11.2 Vc 0.5 +9 5.2 VC 0.5 +10 7.0 VC 0.5 +``` + +### `add_special_chars()` + +Randomly add special characters to character strings: + +```r +set.seed(1234) +add_special_chars(ToothGrowth[1:10,]) +``` + +```r + len supp dose +1 4.2 VC 0.5 +2 11.5 VC 0.5 +3 7.3 VC 0.5 +4 5.8 (VC 0.5 +5 6.4 VC 0.5 +6 10.0 VC 0.5 +7 11.2 VC 0.5 +8 11.2 VC 0.5 +9 5.2 VC 0.5 +10 7.0 VC 0.5 +``` + ### `make_missing()` Randomly make some values missing using `NA`: @@ -169,6 +213,29 @@ make_missing(ToothGrowth[1:10,], cols = "supp", missing = "999") 10 7.0 VC 0.5 ``` +### `messy_colnames()` + +Create messy column names: + +```r +set.seed(1234) +messy_colnames(ToothGrowth[1:10,]) +``` + +```r + )len s(upp dose +1 4.2 VC 0.5 +2 11.5 VC 0.5 +3 7.3 VC 0.5 +4 5.8 VC 0.5 +5 6.4 VC 0.5 +6 10.0 VC 0.5 +7 11.2 VC 0.5 +8 11.2 VC 0.5 +9 5.2 VC 0.5 +10 7.0 VC 0.5 +``` + ### Combining functions You can pipe together multiple functions to create custom messy transformations: @@ -178,7 +245,8 @@ set.seed(1234) ToothGrowth[1:10,] |> make_missing(cols = "supp", missing = " ") |> make_missing(cols = c("len", "dose"), missing = c(NA, 999)) |> - add_whitespace(cols = "supp", messiness = 0.5) + add_whitespace(cols = "supp", messiness = 0.5) |> + add_special_chars(cols = "supp") ``` ```r @@ -186,11 +254,39 @@ ToothGrowth[1:10,] |> 1 4.2 VC 0.5 2 11.5 VC NA 3 7.3 VC 0.5 -4 5.8 VC 0.5 +4 5.8 *VC 0.5 5 6.4 VC 0.5 6 10.0 VC 0.5 7 11.2 0.5 -8 11.2 VC NA -9 5.2 VC 0.5 -10 7.0 VC 0.5 +8 11.2 V#C NA +9 5.2 !VC 0.5 +10 7.0 VC* 0.5 ``` + +If you're adding `messy_colnames()` to a chain (and you specify only some columns in other functions), make sure `messy_colnames()` comes at the end: + +```r +set.seed(1234) +ToothGrowth[1:10,] |> + make_missing(cols = "supp", missing = " ") |> + make_missing(cols = c("len", "dose"), missing = c(NA, 999)) |> + add_whitespace(cols = "supp", messiness = 0.5) |> + add_special_chars(cols = "supp") |> + messy_colnames() +``` + +```r + !l_e)n S^UPP d^o)se +1 4.2 VC 0.5 +2 11.5 VC NA +3 7.3 VC 0.5 +4 5.8 *VC 0.5 +5 6.4 VC 0.5 +6 10.0 VC 0.5 +7 11.2 0.5 +8 11.2 V#C NA +9 5.2 !VC 0.5 +10 7.0 VC* 0.5 +``` + +Otherwise, the column names you try to select may no longer exist! diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..e6fea9e --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,5 @@ +url: https://nrennie.rbind.io/messy/ +template: + package: nrenniepkgdown + bootstrap: 5 + diff --git a/man/add_special_chars.Rd b/man/add_special_chars.Rd new file mode 100644 index 0000000..fa4b4a7 --- /dev/null +++ b/man/add_special_chars.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/add_special_chars.R +\name{add_special_chars} +\alias{add_special_chars} +\title{Add special characters to strings} +\usage{ +add_special_chars(data, cols = NULL, messiness = 0.1) +} +\arguments{ +\item{data}{input dataframe} + +\item{cols}{set of columns to apply transformation to. If \code{NULL} +will apply to all columns. Default \code{NULL}.} + +\item{messiness}{Percentage of values to change. Must be +between 0 and 1. Default 0.1.} +} +\value{ +a dataframe the same size as the input data. +} +\description{ +Add special characters to strings +} +\examples{ +add_special_chars(mtcars) +} diff --git a/man/add_whitespace.Rd b/man/add_whitespace.Rd index 4adaded..fe9706e 100644 --- a/man/add_whitespace.Rd +++ b/man/add_whitespace.Rd @@ -22,3 +22,6 @@ a dataframe the same size as the input data. Randomly add whitespaces to the end of some values in all or a subset of columns. } +\examples{ +add_whitespace(mtcars) +} diff --git a/man/change_case.Rd b/man/change_case.Rd index e126b3f..fbfd031 100644 --- a/man/change_case.Rd +++ b/man/change_case.Rd @@ -4,7 +4,7 @@ \alias{change_case} \title{Change case} \usage{ -change_case(data, cols = NULL, messiness = 0.1) +change_case(data, cols = NULL, messiness = 0.1, case_type = "word") } \arguments{ \item{data}{input dataframe} @@ -14,10 +14,17 @@ will apply to all columns. Default \code{NULL}.} \item{messiness}{Percentage of values to change. Must be between 0 and 1. Default 0.1.} + +\item{case_type}{Whether the case should change based on +the \code{"word"} or \code{"letter"}.} } \value{ a dataframe the same size as the input data. } \description{ Randomly switch between title case and lowercase for +character strings +} +\examples{ +change_case(mtcars) } diff --git a/man/make_missing.Rd b/man/make_missing.Rd index ccdbb87..1f2dc33 100644 --- a/man/make_missing.Rd +++ b/man/make_missing.Rd @@ -27,3 +27,6 @@ a dataframe the same size as the input data. Randomly make values missing in all data columns, or a subset of columns } +\examples{ +make_missing(mtcars) +} diff --git a/man/messy.Rd b/man/messy.Rd index 873e9ad..1c8c2f5 100644 --- a/man/messy.Rd +++ b/man/messy.Rd @@ -4,7 +4,7 @@ \alias{messy} \title{Messy} \usage{ -messy(data, messiness = 0.1, missing = NA) +messy(data, messiness = 0.1, missing = NA, case_type = "word") } \arguments{ \item{data}{input dataframe} @@ -16,6 +16,9 @@ between 0 and 1. Default 0.1.} missing values will be replaced with. If length is greater than 1, values will be replaced randomly. Default \code{NA}.} + +\item{case_type}{Whether the case should change based on +the \code{"word"} or \code{"letter"}.} } \value{ a dataframe the same size as the input data. @@ -23,3 +26,6 @@ a dataframe the same size as the input data. \description{ Make a data frame messier. } +\examples{ +messy(mtcars) +} diff --git a/man/messy_colnames.Rd b/man/messy_colnames.Rd new file mode 100644 index 0000000..4727ba1 --- /dev/null +++ b/man/messy_colnames.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/messy_colnames.R +\name{messy_colnames} +\alias{messy_colnames} +\title{Make column names messy} +\usage{ +messy_colnames(data, messiness = 0.2) +} +\arguments{ +\item{data}{data.frame to alter column names} + +\item{messiness}{Percentage of values to change per function. Must be +between 0 and 1. Default 0.1.} +} +\value{ +data.frame with messy column names +} +\description{ +Adds special characters and randomly +capitalises characters in the column +names of a data frame. +} +\examples{ +messy_colnames(mtcars) +} diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png new file mode 100644 index 0000000..5b5e8a7 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon.png differ diff --git a/pkgdown/favicon/favicon-96x96.png b/pkgdown/favicon/favicon-96x96.png new file mode 100644 index 0000000..5e904e1 Binary files /dev/null and b/pkgdown/favicon/favicon-96x96.png differ diff --git a/pkgdown/favicon/favicon.ico b/pkgdown/favicon/favicon.ico new file mode 100644 index 0000000..2c03a30 Binary files /dev/null and b/pkgdown/favicon/favicon.ico differ diff --git a/pkgdown/favicon/favicon.svg b/pkgdown/favicon/favicon.svg new file mode 100644 index 0000000..8570e10 --- /dev/null +++ b/pkgdown/favicon/favicon.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/pkgdown/favicon/site.webmanifest b/pkgdown/favicon/site.webmanifest new file mode 100644 index 0000000..4ebda26 --- /dev/null +++ b/pkgdown/favicon/site.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/web-app-manifest-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "/web-app-manifest-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} \ No newline at end of file diff --git a/pkgdown/favicon/web-app-manifest-192x192.png b/pkgdown/favicon/web-app-manifest-192x192.png new file mode 100644 index 0000000..c5a9be0 Binary files /dev/null and b/pkgdown/favicon/web-app-manifest-192x192.png differ diff --git a/pkgdown/favicon/web-app-manifest-512x512.png b/pkgdown/favicon/web-app-manifest-512x512.png new file mode 100644 index 0000000..bb4c105 Binary files /dev/null and b/pkgdown/favicon/web-app-manifest-512x512.png differ diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 0000000..2e38bf6 --- /dev/null +++ b/tests/testthat.R @@ -0,0 +1,12 @@ +# This file is part of the standard setup for testthat. +# It is recommended that you do not modify it. +# +# Where should you do additional test configuration? +# Learn more about the roles of various files in: +# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview +# * https://testthat.r-lib.org/articles/special-files.html + +library(testthat) +library(messy) + +test_check("messy") diff --git a/tests/testthat/test-dimension.R b/tests/testthat/test-dimension.R new file mode 100644 index 0000000..c38e1e5 --- /dev/null +++ b/tests/testthat/test-dimension.R @@ -0,0 +1,3 @@ +test_that("Dimensions unchanged", { + expect_equal(dim(mtcars), dim(messy(mtcars))) +})