readInteger: Reads numbers from prompt.

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

Reads number from a prompt.

Usage

1
2
3
readInteger(msg = "", pt = FALSE)

readNumber(msg = "", pt = FALSE)

Arguments

msg

Prompt to be displayed.

pt

Use portuguese messages?

Details

These functions print a prompt and repeats until the correct type of input is read and returns the input. The comments and messages can be displayed in portuguese if option pt is set to TRUE.

readInteger expects an integer from the user and readNumber a number (float or integer).

Value

Number/Integer read.

Examples

1
2
3
4
print(readInteger("Enter an integer: "))
print(readNumber("Enter a number: "))
print(readInteger("Entre com um inteiro: ", pt=TRUE))
print(readNumber("Entre com um numero: ", pt=FALSE))

tunelipt/wutils documentation built on Nov. 5, 2019, 11:01 a.m.