Learn R Programming

sm (version 2.0-2)

ask: Ask data to be typed on the keyboard.

Description

This function prints a message and prompts the user to type in data on the keyboard.

Usage

ask(message="Type in datum")

Arguments

message
a character value, normally something describing the required input

Value

  • the object typed in.

Examples

Run this code
n <- ask("sample size")
nv <- ask("vector of sample sizes")
# in the second case, the user could reply eg with `c(5,10,30)'

Run the code above in your browser using DataLab