get_joke: Retrieves jokes from API

Description Usage Arguments Value Author(s) Examples

View source: R/OfficialJoke.R

Description

Retrieves jokes from API

Usage

1
2
3
4
5
get_joke(
  type = c("general", "knock-knock", "programming"),
  choice = c("random", "ten"),
  return_type = c("list", "dataframe")
)

Arguments

type

The endpoint type, one of general, knock-knock or programming. Default to general if nothing is provided.

choice

The choice type, one of random or ten. Default to random if nothing is provided.

return_type

The return_type, one of list or dataframe. Default to list if nothing is provided.

Value

List with all parameters of that joke

Author(s)

Ximing Zhang

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 

# Retrieve random general joke,return list
joke1 <- get_joke(type = "general",choice="random",return_type="list")

# Retrieve random programming joke,return dataframe
joke2 <- get_joke(type = "programming",choice="random",return_type="dataframe")

# Retrieve ten knock-knock jokes,return list
joke3 <- get_joke(type = "knock-knock",choice="ten",return_type="list")

# Retrieve ten general jokes,return dataframe
joke4 <- get_joke(type = "general",choice="ten",return_type="dataframe")

# Retrieve data with default value
joke5 <- get_joke()

## End(Not run)

zhangxm96/OfficialJokeR documentation built on Dec. 9, 2019, 12:19 a.m.