Package 'choosethis'

Title: Demos of 'cli' Clickable Links
Description: Two sketches: play a text adventure in the console by following the prompts, and perform a data summary using a clickabel interface. Options are presented to the user as clickable links in supported terminals, such as RStudio's console.
Authors: Matt Dray [aut, cre]
Maintainer: Matt Dray <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-11-15 04:05:56 UTC
Source: https://github.com/matt-dray/choosethis

Help Index


Ask to Take the Mean of a Column

Description

Ask to Take the Mean of a Column

Usage

ask_col_mean(dataframe)

Arguments

dataframe

A data.frame. Should have numeric data columns to be summarised.

Details

The user will be prompted to choose a numeric column from the data.frame object provided in 'dataframe'.

Value

Nothing.

Examples

ask_col_mean(mtcars)

Befriend

Description

Befriend

Usage

befriend()

Value

Nothing

Examples

befriend()

Start Your Adventure

Description

Start Your Adventure

Usage

begin(
  show_links = getOption("choosethis.show_links", cli::ansi_has_hyperlink_support())
)

Arguments

show_links

Logical. Present clickable links in the R console? Defaults to the result of cli::ansi_has_hyperlink_support.

Details

Clickable ANSI links are only possible in certain terminals, including RStudio's console but not macOS's Terminal. Use options(choosethis.show_links = FALSE) to force text prompts rather than clickable links.

Value

Nothing.

Examples

begin()

Fight

Description

Fight

Usage

fight()

Value

Nothing

Examples

fight()

Get the Mean

Description

Evaluate the mean of a named column. NAs are removed automatically.

Usage

get_mean(dat, col)

Arguments

dat

A data.frame. A data frame with numeric columns.

col

Character. The name of a numeric column from the 'dat' data.frame.

Value

Numeric. The mean of the numeric column 'col' from data.frame 'dat'.

Examples

get_mean(mtcars, "drat")

Go Left

Description

Go Left

Usage

left(
  show_links = getOption("choosethis.show_links", cli::ansi_has_hyperlink_support())
)

Arguments

show_links

Logical. Present clickable links in the R console? Defaults to the result of cli::ansi_has_hyperlink_support.

Details

Clickable ANSI links are only possible in certain terminals, including RStudio's console but not macOS's Terminal. Use options(choosethis.show_links = FALSE) to force text prompts rather than clickable links.

Value

Nothing

Examples

left()