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 |
Ask to Take the Mean of a Column
ask_col_mean(dataframe)
ask_col_mean(dataframe)
dataframe |
A data.frame. Should have numeric data columns to be summarised. |
The user will be prompted to choose a numeric column from the data.frame object provided in 'dataframe'.
Nothing.
ask_col_mean(mtcars)
ask_col_mean(mtcars)
Befriend
befriend()
befriend()
Nothing
befriend()
befriend()
Start Your Adventure
begin( show_links = getOption("choosethis.show_links", cli::ansi_has_hyperlink_support()) )
begin( show_links = getOption("choosethis.show_links", cli::ansi_has_hyperlink_support()) )
show_links |
Logical. Present clickable links in the R console? Defaults to the result of cli::ansi_has_hyperlink_support. |
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.
Nothing.
begin()
begin()
Evaluate the mean of a named column. NAs are removed automatically.
get_mean(dat, col)
get_mean(dat, col)
dat |
A data.frame. A data frame with numeric columns. |
col |
Character. The name of a numeric column from the 'dat' data.frame. |
Numeric. The mean of the numeric column 'col' from data.frame 'dat'.
get_mean(mtcars, "drat")
get_mean(mtcars, "drat")
Go Left
left( show_links = getOption("choosethis.show_links", cli::ansi_has_hyperlink_support()) )
left( show_links = getOption("choosethis.show_links", cli::ansi_has_hyperlink_support()) )
show_links |
Logical. Present clickable links in the R console? Defaults to the result of cli::ansi_has_hyperlink_support. |
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.
Nothing
left()
left()
Go Right
right( show_links = getOption("choosethis.show_links", cli::ansi_has_hyperlink_support()) )
right( show_links = getOption("choosethis.show_links", cli::ansi_has_hyperlink_support()) )
show_links |
Logical. Present clickable links in the R console? Defaults to the result of cli::ansi_has_hyperlink_support. |
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.
Nothing
right()
right()