diff --git a/NAMESPACE b/NAMESPACE index 19d984b..f41ff1b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,6 +2,9 @@ export(add_whitespace) export(change_case) +export(make_column_names_messy) export(make_missing) +export(make_string_messy) export(messy) importFrom(rlang,.data) +importFrom(stats,runif) diff --git a/R/messy_strings.R b/R/messy_strings.R index ee20e4b..432fe3a 100644 --- a/R/messy_strings.R +++ b/R/messy_strings.R @@ -4,10 +4,10 @@ #' capitalises characters in the provided #' character vector. #' -#' @paramd x string vector to mess up +#' @param x string vector to mess up #' @return string vector that is messed up +#' @export #' @examples -#' #' make_string_messy(c("Hello", "world")) make_string_messy <- function(x){ sapply(x, messy_string, USE.NAMES = FALSE) @@ -18,10 +18,10 @@ make_string_messy <- function(x){ #' Adds special characters and randomly #' capitalises characters in the column #' names of a data frame. -#' @paramd df data.frame to alter column names +#' @param df data.frame to alter column names #' @return data.frame with messy column names +#' @export #' @examples -#' #' make_column_names_messy(iris) make_column_names_messy <- function(df) { # Assign the new column names to the dataframe @@ -34,8 +34,9 @@ make_column_names_messy <- function(df) { #' #' Adds special characters and randomly #' capitalises strings. -#' @params s string to mess up +#' @param s string to mess up #' @return messy string +#' @importFrom stats runif #' @noRd messy_string <- function(s) { random_chars <- c("!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "-", ".") diff --git a/man/make_column_names_messy.Rd b/man/make_column_names_messy.Rd new file mode 100644 index 0000000..bab998c --- /dev/null +++ b/man/make_column_names_messy.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/messy_strings.R +\name{make_column_names_messy} +\alias{make_column_names_messy} +\title{Make column names messy} +\usage{ +make_column_names_messy(df) +} +\arguments{ +\item{df}{data.frame to alter column names} +} +\value{ +data.frame with messy column names +} +\description{ +Adds special characters and randomly +capitalises characters in the column +names of a data frame. +} +\examples{ +make_column_names_messy(iris) +} diff --git a/man/make_string_messy.Rd b/man/make_string_messy.Rd new file mode 100644 index 0000000..a8ffc35 --- /dev/null +++ b/man/make_string_messy.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/messy_strings.R +\name{make_string_messy} +\alias{make_string_messy} +\title{Make character vector messy} +\usage{ +make_string_messy(x) +} +\arguments{ +\item{x}{string vector to mess up} +} +\value{ +string vector that is messed up +} +\description{ +Adds special characters and randomly +capitalises characters in the provided +character vector. +} +\examples{ +make_string_messy(c("Hello", "world")) +}