Package 'hitchr'

Title: A random sample generator based on The Hitchhiker's Guide to the Galaxy
Description: Generates random samples containing races described in The Hitchhiker's Guide to the Galaxy.
Authors: Bjørn Peare Bartholdy [aut, cre]
Maintainer: Bjørn Peare Bartholdy <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-11-04 03:06:41 UTC
Source: https://github.com/bbartholdy/hitchr

Help Index


Function to create a random sample of Dentrassi

Description

Function to create a random sample of Dentrassi

Usage

dentrassi(n, stats = stats_index(), ...)

Arguments

n

numeric. Number of individuals to create.

stats

which stats to include in the sample. See 'stats_index()' for a list of available stats.

...

currently serves no function.

Details

In the current edition of The Guide, there is no entry for the Dentrassi. However, they are described as 'an unruly tribe of gourmands, a wild but pleasant bunch whom the Vogons had recently taken to employ as catering staff on their long-haul fleets (...)'.

Douglas Adams, Hitchiker's Guide to the Galaxy


Dentrassi Occupations

Description

A list of dentrassi occupations

Usage

dentrassi_occupations

Format

A data frame with ? rows and 1 variable.

Source

include source...


Function to create a random sample of Golgafrinchans

Description

Function to create a random sample of Golgafrinchans

Usage

golgafrinchans(n, stats = stats_index(), ...)

Arguments

n

numeric. Number of individuals to create.

stats

which stats to include in the sample. See 'stats_index()' for a list of available stats.

...

currently serves no function.

Details

The Golgafrinchans generated from this particular function are the middlemen, who were the only remaining Golgafrinchans after the only useful part of the population, the 'doers' and the 'thinkers', got wiped out by a disease contracted from a dirty telephone. They are also believed to be the true ancestors of humans. As such, the only occupations available are Lawyer, Hairdresser, and Telephone Sanitiser.


Human Occupations

Description

A list of human occupations

Usage

human_occupations

Format

A data frame with ? rows and 1 variable.

Source

include source...


Random sample of humans

Description

The entry in The Guide for Earth: "Mostly harmless."

Usage

humans(n, stats = stats_index(), ...)

Arguments

n

numeric. Number of individuals to create.

stats

which stats to include in the sample. See 'stats_index()' for a list of available stats.

...

currently serves no function.

Details

Function to create a random sample of humans


The Infinite Improbability Drive

Description

Generates a random sample of individuals.

Usage

infinite_improbability_drive(
  n,
  race = race_index(),
  na_prob = NULL,
  quiet = T,
  symm = T,
  ...
)

iidr(n, race = race_index(), na_prob = NULL, quiet = T, symm = T, ...)

Arguments

n

number of individuals to generate.

race

which races to include in the generated sample. Default is all.

na_prob

Numeric. Proportion of values that should be missing at random. Must be a number between 0 and 1.

quiet

if FALSE, will print a statement about the odds of a random event. Default is TRUE.

symm

logical. whether the missing values should be inserted symmetrically, i.e., whether each column should contain the same number of NAs.

...

can be used to pass 'stats' through to race-specific functions. see example.


Inserts NAs throughout a data frame at random

Description

Inserts NAs throughout a data frame at random

Usage

missing(x, na_prob = 0.1, cols = seq_along(x), symm = F)

Arguments

x

Data frame or vector.

na_prob

the probability of missing values per variable in the data frame. Default is 0.1, i.e. each variable will have 10% NAs.

cols

numeric. In which columns to insert NAs. Default is all columns. To leave out the first column, use cols = -1.

symm

logical. whether the missing values should be inserted symmetrically, i.e., whether each column should contain the same number of NAs.

Details

Function is a modified version of 'r_na' and r_na_vector' from the 'wakefield' package. It adds the functionality to add NAs asymmetrically to a data frame, meaning the number of NAs per column will vary.

Value

Returns the original data frame with NAs inserted. The default settings returns a data frame with data missing completely at random.

See Also

r_na


The Guide

Description

The Guide

Usage

the_guide()

This function is about the most massively useful thing in this package.

Description

This function is about the most massively useful thing in this package.

Usage

towel(x, rowwise = F, colwise = T, cols = NULL)

Arguments

x

data frame containing NAs.

rowwise

perform rowwise calculation of NAs.

colwise

perform colwise calculation of NAs (default).

cols

columns on which to perform calculation (default is all columns).


Vogon Occupations

Description

A list of vogon occupations. The original list was the same as the human occupations, but with all non-administrative jobs removed.

Usage

vogon_occupations

Format

A data frame with ? rows and 1 variable.

Source

same as humans...


This function creates randomly generated Vogon poetry, thought to be the third worst poetry in the universe, only surpassed by that of the Azgoths of Kria, and Paula Nancy Millstone Jennings of Sussex.

Description

This function creates randomly generated Vogon poetry, thought to be the third worst poetry in the universe, only surpassed by that of the Azgoths of Kria, and Paula Nancy Millstone Jennings of Sussex.

Usage

vogon_poetry()

Function to create a random sample of Vogons

Description

Function to create a random sample of Vogons

Usage

vogons(n, stats = stats_index(), ...)

Arguments

n

numeric. Number of individuals to create.

stats

which stats to include in the sample. See 'stats_index()' for a list of available stats.

...

currently serves no function.

Details

The Guide on Vogons: "They are one of the most unpleasant races in the Galaxy – not actually evil, but bad-tempered, bureaucratic, officious and callous. They wouldn't even lift a finger to save their own grandmothers from the Ravenous Bugblatter Beast of Traal without orders signed in triplicate, sent in, sent back, queried, lost, found, subjected to public inquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters."

"The best way to get a drink out of a Vogon is to stick your finger down his throat, and the best way to irritate him is to feed his grandmother to the Ravenous Bugblatter Beast of Traal."

"On no account allow a Vogon to read poetry at you."

Douglas Adams, Hitchiker's Guide to the Galaxy

Most notable about Vogons is that the majority of occupations are administrative in nature; they are born/appear fully educated for said occupation; and the males and females of the species are completely indistinguishable.