diff --git a/.Rbuildignore b/.Rbuildignore index 0b0a081..104c1a7 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,7 @@ ^despair\.Rproj$ ^\.Rproj\.user$ ^LICENSE\.md$ +^README\.Rmd$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ diff --git a/.gitignore b/.gitignore index 7c794aa..457525e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .httr-oauth .DS_Store .quarto +docs diff --git a/DESCRIPTION b/DESCRIPTION index 15bbc25..87497e2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,13 +1,13 @@ Package: despair -Title: What the Package Does (One Line, Title Case) -Version: 0.0.0.9000 +Title: (de)Motivational quotes and Shakespearian bard–bits for use in personal projects +Version: 0.1.0 Authors@R: person("JP", "Monteagudo", email = "jpmonteagudo2014@gmail.com", role = c("aut", "cre"), - comment = c(ORCID = "0009-0003-6465-6658")) + comment = c(ORCID = "0009-0003-6465-6658")) Maintainer: JP Monteagudo -Description: This generates demotivation and motivational quotes that a user can consider for their personal projects, to mitigate the unavoidable sadness after long hours of coding, or to share with friends. The user can also supply a numeric or character seed to ensure reproducible results. +Description: This generates (de)motivational quotes and Shakespearian word combintations (bard–bits) that a user can consider for their personal projects, to mitigate the unavoidable sadness after long hours of coding, or to share with friends. The user can also supply a numeric or character seed to ensure reproducible results. License: GPL (>= 3) Encoding: UTF-8 Roxygen: list(markdown = TRUE) @@ -15,3 +15,6 @@ RoxygenNote: 7.3.2 LazyData: true URL: https://github.com/jpmonteagudo28/despair BugReports: https://github.com/jpmonteagudo28/despair/issues +Suggests: + testthat (>= 3.0.0) +Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index 5996c0d..8a3ea4e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,6 @@ # Generated by roxygen2: do not edit by hand +export(bard.bits) export(demotivate) export(despair.message) export(motivate) diff --git a/NEWS.md b/NEWS.md index 0ce63fd..6270875 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,3 @@ -# despair (development version) +# despair 0.1.0 -* Initial CRAN submission. +* Initial development release diff --git a/R/bard.bits.R b/R/bard.bits.R index dc53b8a..68ab4d8 100644 --- a/R/bard.bits.R +++ b/R/bard.bits.R @@ -1,7 +1,48 @@ -bard.bits <- functions(cat, +#' Generate unique bard bits using Shakespeare's work and DSM-5 adjectives +#' +#' @description +#' \code{bard.bits()} generates bard bits using Shakespeare's works and the DSM-5 to use in personal projects. The term bard–bits comes from Shakespeare's title +#' 'The Bard of Avon' and the bits ( Shakespeare's characters, places, professions) used to come up with coherent combinations. +#' +#' @details +#' When the category is 'any' (the default), the function combines Shakespeare's adjectives, +#' DSM-5 adjectives, colors and the characters, jobs, animals and things data frames +#' to then sample one adjective and one noun from each of the two combinations. +#' +#' When the category is 'alliterate', the function combines the adjectives and colors +#' data frames and the animals and characters data frame. After an adjective is selected, +#' the first letter will be used to match against a noun. +#' +#' When the category is 'character', the function will derive a bard bit from a data frame of Shakespeare's +#' characters and the adjectives data frame. +#' +#' When the category is 'jobs', the function will derive a bard bit from the adjectives and colors data frame +#' and sample one value from the Shakespeare's jobs data frame. +#' +#' When the category is 'dsm_5', the function will derive a bard bit from the combined jobs, +#' characters, animals and the DSM-5 adjectives data frame. +#' +#' @param cat a category to be used as bard–bit. Defaults to "any", but "character", +#' "jobs","alliterate", "dsm_5" are available. +#' @param seed an optional numeric or character seed for reproducible results. +#' +#' @return \code{bard.bits()} takes a category and an optional numeric or character seed +#' to produce a bard–bit. +#' @export +#' +#' @author JP Monteagudo +#' +#' @examples +#' bard.bits("any") +#' bard.bits("dsm_5", seed = 1234) +#' bard.bits("jobs", seed = "horrid antonio") +#' +bard.bits <- function(cat, seed = NULL){ + valid_cats <- c("any","character", - "jobs","alliterate") + "jobs","alliterate", + "dsm_5") cat <- match.arg(cat, valid_cats, @@ -18,13 +59,55 @@ bard.bits <- functions(cat, set.seed(seed) } - if(cat == "any"){} + if(cat == "any"){ + adjs <- rbind(shake_adjectives,shake_clrs, dsm_5) + one_adj <- sample(unique(adjs$values),1) + + nouns <- rbind(shake_animals,shake_jobs,shake_things,shake_chars) + one_noun <- sample(unique(nouns$values),1) + + my_bit <- paste(one_adj,one_noun) + } + + if(cat == "character"){ + one_adj <- sample(shake_adjectives$values,1) + + one_noun <- sample(shake_chars$values,1) + + my_bit <- paste(one_adj, one_noun) + } + + if(cat == "jobs"){ + adjs <- rbind(shake_adjectives,shake_clrs) + one_adj <- sample(unique(adjs$values),1) - if(cat = "character"){} + one_noun <- sample(shake_jobs$values,1) - if(cat = "jobs"){} + my_bit<- paste(one_adj,one_noun) + } + + if(cat == "alliterate"){ + adjs <- rbind(shake_adjectives, shake_clrs) + adjs <- subset(adjs, sapply(strsplit(adjs$values, " "), length) == 1) + + nouns <-rbind(shake_animals, shake_chars) + one_noun <- sample(unique(nouns$values),1) + one_st <- substring(one_noun,1,1) - if(cat = "alliterate"){} + letter_match <- subset(adjs,substr(adjs$values,1,1)== one_st) + one_adj <- sample(letter_match$values,1) + + my_bit <- paste(one_adj,one_noun) + } + + if(cat == "dsm_5"){ + nouns <- rbind(shake_jobs,shake_chars,shake_animals) + one_noun <- sample(unique(nouns$values),1) + + one_adj <- sample(dsm_5$values,1) + + my_bit <- paste(one_adj,one_noun) + } return(my_bit) } diff --git a/R/data.R b/R/data.R index 79d8255..30e0cd4 100644 --- a/R/data.R +++ b/R/data.R @@ -4,7 +4,7 @@ #' #' @format a data frame with 13 observations and1 column #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "family" @@ -15,7 +15,7 @@ #' #' @format a data frame with 27 observations and 1 column #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "life" @@ -26,7 +26,7 @@ #' #' @format a data frame with 22 observations and 1 column #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "lit" @@ -36,7 +36,7 @@ #' This is a data frame of modern and contemporary historical and pop-culture icons used in \code{motivate()} #' @format a data frame of with 40 observations and 1 column #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "modern" @@ -47,7 +47,7 @@ #' #' @format a data frame with 34 observations and 1 column #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "psych" @@ -58,7 +58,7 @@ #' #' @format a data frame with 21 observations and 1 column #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "rednecks" @@ -69,7 +69,7 @@ #' #'@format a data frame with 45 observations and 1 column. #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "religion" @@ -80,7 +80,7 @@ #' #' @format a data frame of 27 observations and 1 column. #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "science" @@ -91,7 +91,7 @@ #' #' @format a data frame with 32 observations and 1 column. #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "stoic" @@ -102,7 +102,7 @@ #' #' @format a data frame with 23 observations and 1 column #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "tv" @@ -113,7 +113,84 @@ #' #' @format a data frame with 31 observations and 1 column #' \describe{ -#' \item{\code{value}}{a character vector} +#' \item{\code{values}}{a character vector} #' } #' "work" + +#' A data frame of Shakespeare's characters +#' +#' This is a data frame of Shakespeare's characters +#' +#' @format a data frame with 137 observations and 1 column +#' \describe{ +#' \item{\code{values}}{a character vector} +#' } +#' +"shake_chars" + +#' A data frame of Shakespeare's adjectives +#' +#' This is a data frame of adjectives used in Shakespeare's works. +#' +#' @format a data frame with 100 observations and 1 column +#' \describe{ +#' \item{\code{values}}{a character vector} +#' } +#' +"shake_adjectives" + +#' A data frame of Shakespeare's animals +#' +#' This is a data frame of animals used in Shakespeare's works +#' +#' @format a data frame with 150 observations and 1 column +#' \describe{ +#' \item{\code{values}}{a character vector} +#' } +#' +"shake_animals" + +#' A data frame of Shakespeare and unusual colors +#' +#' This is a data frame of colors used in Shakespeare's work and other unusual colors +#' +#' @format a data frame with 300 observations and 1 column +#' \describe{ +#' \item{\code{values}}{a character vector} +#' } +#' +"shake_clrs" + +#' A data frame of Shakespeare's jobs +#' +#' This is a data frame of professions used in Shakespeare's works. +#' +#' @format a data frame with 103 observations and 1 column +#' \describe{ +#' \item{\code{values}}{a character vector} +#' } +#' +"shake_jobs" + +#' A data frame of Shakespeare's objects +#' +#' This is a data frame of objects used in Shakespeare's works. +#' +#' @format a data frame with 150 observations and 1 column +#' \describe{ +#' \item{\code{values}}{a character vector} +#' } +#' +"shake_things" + +#' A data frame of DSM-5 adjectives +#' +#' This is a data frame of adjectives used in the DSM-5 to describe mental states +#' +#' @format a data frame with 150 observations and 1 column +#' \describe{ +#' \item{\code{values}}{a character vector} +#' } +#' +"dsm_5" diff --git a/R/demotivate.R b/R/demotivate.R index 5b98130..d666078 100644 --- a/R/demotivate.R +++ b/R/demotivate.R @@ -71,5 +71,5 @@ demotivate <- function(cat = "any", if(cat == "family"){ my_quote <- sample(family$values,1) } - return(cat(my_quote)) + return(my_quote) } diff --git a/R/despair_message.R b/R/despair_message.R index 40e86ff..55b24f1 100644 --- a/R/despair_message.R +++ b/R/despair_message.R @@ -1,3 +1,5 @@ +# Code for this function modified from package `codename` by Steven Miller under license GPL -2. + #' Display package version for \pkg{despair} #' #' @description \code{despair.message()} produces a message about the package version diff --git a/R/motivate.R b/R/motivate.R index e0adfbd..c7011e2 100644 --- a/R/motivate.R +++ b/R/motivate.R @@ -71,5 +71,5 @@ motivate <- function(cat = "any", if(cat == "lit"){ my_quote <- sample(lit$values,1) } - return(cat(my_quote)) + return(my_quote) } diff --git a/R/set.char.seed.R b/R/set.char.seed.R index d089b8d..09d8977 100644 --- a/R/set.char.seed.R +++ b/R/set.char.seed.R @@ -1,3 +1,5 @@ +# Code for this function modified from package `codename` by Steven Miller under license GPL -2. + #' Convert any character vector to an integer for setting a reproducible seed #' #' @description @@ -9,7 +11,7 @@ #' numbers are concatenated and divided by 2^39 - 1, and the remainder of this division #' is used as the numeric reproducible seed. #' -#' If you get a warning about 'loss of accuracy", consider using a more succint character +#' If you get a warning about 'loss of accuracy", consider using a more succinct character #' vector, otherwise you may get a seed of 0. #' #' @param char a character vector @@ -18,6 +20,8 @@ #' #' @author JP Monteagudo #' +#' @keywords internals +#' #' #' @examples #' set.char.seed("The Sticky Chicken") @@ -30,14 +34,13 @@ set.char.seed <- function(char) { names(temp) <- c(LETTERS, letters, 0:9) char <- gsub("[^0-9a-zA-Z]","",as.character(char)) - char_split <- temp[ strsplit(char,'')[[1]] ] - char_split + split_it <- temp[ strsplit(char,'')[[1]] ] + split_it - num_seed <- as.numeric(paste(char_split, collapse="")) + num_seed <- as.numeric(paste(split_it, collapse="")) num_seed seed <- as.integer( num_seed %% (2^31-1) ) return(seed) - } diff --git a/R/xxx.R b/R/xxx.R index 4b1890a..0c06d08 100644 --- a/R/xxx.R +++ b/R/xxx.R @@ -6,5 +6,7 @@ if(getRversion() >= "2.15.1") # underlying data used for behind-the-scenes handsomeness c("family", "life", "lit", "modern", "psych", "rednecks", "religion", "science", "stoic", - "tv","work", "shake_nouns","shake_adjectives","shake_animals") + "tv","work","shake_adjectives","shake_animals", + "shake_things","shake_jobs","shake_chars","shake_clrs", + "dsm_5") ) diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..c6cd381 --- /dev/null +++ b/README.Rmd @@ -0,0 +1,54 @@ +--- +output: github_document +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "man/figures/README-", + out.width = "100%" +) +``` + +# despair + + + + +The goal of despair is to ... + +## Installation + +You can install the development version of despair like so: + +``` r +# FILL THIS IN! HOW CAN PEOPLE INSTALL YOUR DEV PACKAGE? +``` + +## Example + +This is a basic example which shows you how to solve a common problem: + +```{r example} +library(despair) +## basic example code +``` + +What is special about using `README.Rmd` instead of just `README.md`? You can include R chunks like so: + +```{r cars} +summary(cars) +``` + +You'll still need to render `README.Rmd` regularly, to keep `README.md` up-to-date. `devtools::build_readme()` is handy for this. + +You can also embed plots, for example: + +```{r pressure, echo = FALSE} +plot(pressure) +``` + +In that case, don't forget to commit and push the resulting figure files, so they display on GitHub and CRAN. diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..47742b3 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,25 @@ +home: + title: An R package for (de)motivation and bard–bis generation + description: (de)motivational quotes and Shakespearian word combintations (bard–bits) to mitigate the unavoidable sadness after long hours of coding. + +url: https://www.despair.jpmonteagudo.com +template: + bootstrap: 5 + bslib: + bg: "#84B4BF" + fg: "#F2E1C2" + primary: "#7C225C" + base_font: {google: "Fira Sans Condensed"} + heading_font: {google: "Eagle Lake"} + code_font: {google: "Fira Code"} + + navbar: + bg: primary + structure: + left: [intro, reference, news] + right: [github] + footer: + structure: + left: developed_by + right: built_with + diff --git a/data/dsm_5.rda b/data/dsm_5.rda new file mode 100644 index 0000000..24a0e2a Binary files /dev/null and b/data/dsm_5.rda differ diff --git a/data/shake_adjectives.rda b/data/shake_adjectives.rda index da42f43..95ad3c6 100644 Binary files a/data/shake_adjectives.rda and b/data/shake_adjectives.rda differ diff --git a/data/shake_animals.rda b/data/shake_animals.rda index 3bca8ad..58432c9 100644 Binary files a/data/shake_animals.rda and b/data/shake_animals.rda differ diff --git a/data/shake_chars.rda b/data/shake_chars.rda new file mode 100644 index 0000000..b3e4364 Binary files /dev/null and b/data/shake_chars.rda differ diff --git a/data/shake_clrs.rda b/data/shake_clrs.rda index d4d9365..e700fe9 100644 Binary files a/data/shake_clrs.rda and b/data/shake_clrs.rda differ diff --git a/data/shake_jobs.rda b/data/shake_jobs.rda index 5ba7c73..827d470 100644 Binary files a/data/shake_jobs.rda and b/data/shake_jobs.rda differ diff --git a/data/shake_nouns.rda b/data/shake_nouns.rda deleted file mode 100644 index ed06d14..0000000 Binary files a/data/shake_nouns.rda and /dev/null differ diff --git a/data/shake_things.rda b/data/shake_things.rda index 7e5910c..2d3ea61 100644 Binary files a/data/shake_things.rda and b/data/shake_things.rda differ diff --git a/man/bard.bits.Rd b/man/bard.bits.Rd new file mode 100644 index 0000000..eb4547e --- /dev/null +++ b/man/bard.bits.Rd @@ -0,0 +1,49 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bard.bits.R +\name{bard.bits} +\alias{bard.bits} +\title{Generate unique bard bits using Shakespeare's work and DSM-5 adjectives} +\usage{ +bard.bits(cat, seed = NULL) +} +\arguments{ +\item{cat}{a category to be used as bard–bit. Defaults to "any", but "character", +"jobs","alliterate", "dsm_5" are available.} + +\item{seed}{an optional numeric or character seed for reproducible results.} +} +\value{ +\code{bard.bits()} takes a category and an optional numeric or character seed +to produce a bard–bit. +} +\description{ +\code{bard.bits()} generates bard bits using Shakespeare's works and the DSM-5 to use in personal projects. The term bard–bits comes from Shakespeare's title +'The Bard of Avon' and the bits ( Shakespeare's characters, places, professions) used to come up with coherent combinations. +} +\details{ +When the category is 'any' (the default), the function combines Shakespeare's adjectives, +DSM-5 adjectives, colors and the characters, jobs, animals and things data frames +to then sample one adjective and one noun from each of the two combinations. + +When the category is 'alliterate', the function combines the adjectives and colors +data frames and the animals and characters data frame. After an adjective is selected, +the first letter will be used to match against a noun. + +When the category is 'character', the function will derive a bard bit from a data frame of Shakespeare's +characters and the adjectives data frame. + +When the category is 'jobs', the function will derive a bard bit from the adjectives and colors data frame +and sample one value from the Shakespeare's jobs data frame. + +When the category is 'dsm_5', the function will derive a bard bit from the combined jobs, +characters, animals and the DSM-5 adjectives data frame. +} +\examples{ +bard.bits("any") +bard.bits("dsm_5", seed = 1234) +bard.bits("jobs", seed = "horrid antonio") + +} +\author{ +JP Monteagudo +} diff --git a/man/dsm_5.Rd b/man/dsm_5.Rd new file mode 100644 index 0000000..5a6edcc --- /dev/null +++ b/man/dsm_5.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{dsm_5} +\alias{dsm_5} +\title{A data frame of DSM-5 adjectives} +\format{ +a data frame with 150 observations and 1 column +\describe{ +\item{\code{values}}{a character vector} +} +} +\usage{ +dsm_5 +} +\description{ +This is a data frame of adjectives used in the DSM-5 to describe mental states +} +\keyword{datasets} diff --git a/man/family.Rd b/man/family.Rd index 6c53639..44cd864 100644 --- a/man/family.Rd +++ b/man/family.Rd @@ -7,7 +7,7 @@ \format{ a data frame with 13 observations and1 column \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/man/life.Rd b/man/life.Rd index 2ced49f..01269a6 100644 --- a/man/life.Rd +++ b/man/life.Rd @@ -7,7 +7,7 @@ \format{ a data frame with 27 observations and 1 column \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/man/lit.Rd b/man/lit.Rd index 56749f9..d4f062e 100644 --- a/man/lit.Rd +++ b/man/lit.Rd @@ -7,7 +7,7 @@ \format{ a data frame with 22 observations and 1 column \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/man/modern.Rd b/man/modern.Rd index ede16d9..ee1235d 100644 --- a/man/modern.Rd +++ b/man/modern.Rd @@ -7,7 +7,7 @@ \format{ a data frame of with 40 observations and 1 column \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/man/psych.Rd b/man/psych.Rd index e94d9e2..a29aafe 100644 --- a/man/psych.Rd +++ b/man/psych.Rd @@ -7,7 +7,7 @@ \format{ a data frame with 34 observations and 1 column \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/man/rednecks.Rd b/man/rednecks.Rd index 720667a..1651bee 100644 --- a/man/rednecks.Rd +++ b/man/rednecks.Rd @@ -7,7 +7,7 @@ \format{ a data frame with 21 observations and 1 column \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/man/religion.Rd b/man/religion.Rd index b07e5d1..31fa6db 100644 --- a/man/religion.Rd +++ b/man/religion.Rd @@ -7,7 +7,7 @@ \format{ a data frame with 45 observations and 1 column. \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/man/science.Rd b/man/science.Rd index 75ba862..0e64c82 100644 --- a/man/science.Rd +++ b/man/science.Rd @@ -7,7 +7,7 @@ \format{ a data frame of 27 observations and 1 column. \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/man/set.char.seed.Rd b/man/set.char.seed.Rd index bcf73e9..bd30942 100644 --- a/man/set.char.seed.Rd +++ b/man/set.char.seed.Rd @@ -21,7 +21,7 @@ Each letter and number in the character vector is assigned a specific number. Th numbers are concatenated and divided by 2^39 - 1, and the remainder of this division is used as the numeric reproducible seed. -If you get a warning about 'loss of accuracy", consider using a more succint character +If you get a warning about 'loss of accuracy", consider using a more succinct character vector, otherwise you may get a seed of 0. } \examples{ @@ -34,3 +34,4 @@ set.char.seed("Manny said what?") \author{ JP Monteagudo } +\keyword{internals} diff --git a/man/shake_adjectives.Rd b/man/shake_adjectives.Rd new file mode 100644 index 0000000..2775ec4 --- /dev/null +++ b/man/shake_adjectives.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{shake_adjectives} +\alias{shake_adjectives} +\title{A data frame of Shakespeare's adjectives} +\format{ +a data frame with 100 observations and 1 column +\describe{ +\item{\code{values}}{a character vector} +} +} +\usage{ +shake_adjectives +} +\description{ +This is a data frame of adjectives used in Shakespeare's works. +} +\keyword{datasets} diff --git a/man/shake_animals.Rd b/man/shake_animals.Rd new file mode 100644 index 0000000..5eb0d5f --- /dev/null +++ b/man/shake_animals.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{shake_animals} +\alias{shake_animals} +\title{A data frame of Shakespeare's animals} +\format{ +a data frame with 150 observations and 1 column +\describe{ +\item{\code{values}}{a character vector} +} +} +\usage{ +shake_animals +} +\description{ +This is a data frame of animals used in Shakespeare's works +} +\keyword{datasets} diff --git a/man/shake_chars.Rd b/man/shake_chars.Rd new file mode 100644 index 0000000..4a183e2 --- /dev/null +++ b/man/shake_chars.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{shake_chars} +\alias{shake_chars} +\title{A data frame of Shakespeare's characters} +\format{ +a data frame with 137 observations and 1 column +\describe{ +\item{\code{values}}{a character vector} +} +} +\usage{ +shake_chars +} +\description{ +This is a data frame of Shakespeare's characters +} +\keyword{datasets} diff --git a/man/shake_clrs.Rd b/man/shake_clrs.Rd new file mode 100644 index 0000000..6efa1ed --- /dev/null +++ b/man/shake_clrs.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{shake_clrs} +\alias{shake_clrs} +\title{A data frame of Shakespeare and unusual colors} +\format{ +a data frame with 300 observations and 1 column +\describe{ +\item{\code{values}}{a character vector} +} +} +\usage{ +shake_clrs +} +\description{ +This is a data frame of colors used in Shakespeare's work and other unusual colors +} +\keyword{datasets} diff --git a/man/shake_jobs.Rd b/man/shake_jobs.Rd new file mode 100644 index 0000000..0075c88 --- /dev/null +++ b/man/shake_jobs.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{shake_jobs} +\alias{shake_jobs} +\title{A data frame of Shakespeare's jobs} +\format{ +a data frame with 103 observations and 1 column +\describe{ +\item{\code{values}}{a character vector} +} +} +\usage{ +shake_jobs +} +\description{ +This is a data frame of professions used in Shakespeare's works. +} +\keyword{datasets} diff --git a/man/shake_things.Rd b/man/shake_things.Rd new file mode 100644 index 0000000..d130408 --- /dev/null +++ b/man/shake_things.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{shake_things} +\alias{shake_things} +\title{A data frame of Shakespeare's objects} +\format{ +a data frame with 150 observations and 1 column +\describe{ +\item{\code{values}}{a character vector} +} +} +\usage{ +shake_things +} +\description{ +This is a data frame of objects used in Shakespeare's works. +} +\keyword{datasets} diff --git a/man/stoic.Rd b/man/stoic.Rd index d29e028..a4b7903 100644 --- a/man/stoic.Rd +++ b/man/stoic.Rd @@ -7,7 +7,7 @@ \format{ a data frame with 32 observations and 1 column. \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/man/tv.Rd b/man/tv.Rd index 01c37b1..4793130 100644 --- a/man/tv.Rd +++ b/man/tv.Rd @@ -7,7 +7,7 @@ \format{ a data frame with 23 observations and 1 column \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/man/work.Rd b/man/work.Rd index 5c635ff..45fe615 100644 --- a/man/work.Rd +++ b/man/work.Rd @@ -7,7 +7,7 @@ \format{ a data frame with 31 observations and 1 column \describe{ -\item{\code{value}}{a character vector} +\item{\code{values}}{a character vector} } } \usage{ diff --git a/shake_chars.rda b/shake_chars.rda deleted file mode 100644 index e542d89..0000000 Binary files a/shake_chars.rda and /dev/null differ diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 0000000..90ec871 --- /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(despair) + +test_check("despair") diff --git a/tests/testthat/test-bard.bits.R b/tests/testthat/test-bard.bits.R new file mode 100644 index 0000000..ff43bf3 --- /dev/null +++ b/tests/testthat/test-bard.bits.R @@ -0,0 +1,5 @@ +test_that("returns character", { + expect_equal(bard.bits("dsm_5", seed = 1234), "fragile hen") +}) + +#> test passed diff --git a/tests/testthat/test-demotivate.R b/tests/testthat/test-demotivate.R new file mode 100644 index 0000000..ab5eeb8 --- /dev/null +++ b/tests/testthat/test-demotivate.R @@ -0,0 +1,5 @@ +test_that("returns character", { + expect_equal(demotivate("science", seed = 1234),"Gravity: making sure you never get too high on your achievements.") +}) + +#> test passed diff --git a/tests/testthat/test-despair_message.R b/tests/testthat/test-despair_message.R new file mode 100644 index 0000000..3e07ef7 --- /dev/null +++ b/tests/testthat/test-despair_message.R @@ -0,0 +1,5 @@ +test_that("returns NULL", { + expect_equal(despair.message(), NULL) +}) + +#> test passed diff --git a/tests/testthat/test-motivate.R b/tests/testthat/test-motivate.R new file mode 100644 index 0000000..0e2ab95 --- /dev/null +++ b/tests/testthat/test-motivate.R @@ -0,0 +1,5 @@ +test_that("returns character", { + expect_equal(motivate("any",seed = 1234), "The difference between passion and addiction is that between a divine spark and a flame that incinerates. - Gabor Maté") +}) + +#> test passed diff --git a/tests/testthat/test-set.char.seed.R b/tests/testthat/test-set.char.seed.R new file mode 100644 index 0000000..f66c815 --- /dev/null +++ b/tests/testthat/test-set.char.seed.R @@ -0,0 +1,5 @@ +test_that("returns a numeric vector 1L", { + expect_equal(set.char.seed("stupefied lepricon"), 649068544) +}) + +#> test passed