Package 'dadjokeapi'

Title: Return a Random Dad Joke
Description: What is funnier than a dad joke? A dad joke in R! This package utilizes the API for <https://icanhazdadjoke.com> and returns dad jokes from several API endpoints.
Authors: Jeffrey Hollister [aut, cre], Antoine Bichat [ctb], Brett Langdon [cph]
Maintainer: Jeffrey Hollister <[email protected]>
License: MIT + file LICENSE
Version: 1.0.2
Built: 2026-05-28 07:19:37 UTC
Source: https://github.com/jhollist/dadjokeapi

Help Index


Function to return random dad joke

Description

This function returns a random dad joke(s) from https://icanhazdadjoke.com. as a message and invisibly as a character.

Usage

groan(sting = TRUE)

Arguments

sting

Plays a joke sting after the joke. Sound from https://archive.org/details/Rimshot_254

Value

Invisibly returns a two item list with the first item holding the joke as a character and the second item containing the joke id as a character.

Examples

groan(sting = FALSE)

Function to return a specific dad joke

Description

This function returns a specific dad joke from https://icanhazdadjoke.com using its dad joke ID.

Usage

groan_id(joke_id)

Arguments

joke_id

A specific dad joke ID to return

Value

Returns a two item list with the first item holding the joke as a character and the second item containing the joke id as a character.

Examples

groan_id("GlGBIY0wAAd")

Function to return a specific dad joke as an image

Description

This function returns a specific dad joke as a png from https://icanhazdadjoke.com using its dad joke ID.

Usage

groan_image(joke_id)

Arguments

joke_id

A specific dad joke ID to return

Value

Returns a png array from readPNG.

Examples

joke_png <- groan_image("GlGBIY0wAAd")