userInput: userInput let the user type in a character string

View source: R/userInput.R

userInputR Documentation

userInput let the user type in a character string

Description

this is useful for asking the user for a username or password, so that it goes directly to a variable and doesn't get inadvertently saved into an R script. There are no arguments. This will only return a character string. This is low key, don't bother using it for data entry. Just type characters, no need to put it in quotes, pressing enter will cause the function to return. Output will not be printed to the console, but it can be assigned directly. This is useful to have as an auxiliary function in case multiple calls to functions such as readHMDweb() are desired.

Usage

userInput(silent = FALSE)

Arguments

silent

logical should a little prompt be given, telling the user to enter text in the console?

Value

a character string, as given by the user.

Examples

### mypassword <- userInput()
### myusername <- userInput()
### DAT <- readHMDweb("USA","mltper_1x1",mypassword,myusername)


HMDHFDplus documentation built on July 9, 2023, 6:26 p.m.