[R] User input from keyboard

Petr Pikal petr.pikal at precheza.cz
Fri Aug 4 14:19:46 CEST 2006


Hi

cat("\n","Enter x","\n") # prompt
y<-scan(n=1)

prompts for user imput and scans 1 line from console.

HTH
Petr



On 4 Aug 2006 at 17:06, chiya sharma wrote:

Date sent:      	Fri, 4 Aug 2006 17:06:38 +0530
From:           	"chiya sharma" <chiya31 at gmail.com>
To:             	r-help at stat.math.ethz.ch
Subject:        	[R] User input from keyboard

> Dear All,
> 
>  Can anybody tell me the syntax for "User input from keyboard" in R. I
>  mean
> to say that if I run the program it should ask "Please enter the date"
> at the begining of the program. I am using R-2.2.1 for windows.
> 
> Any help will be greatly appreciated.
> thanks in advance.
> 
> Regards,
> Chiya
> 
>  [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html and provide commented,
> minimal, self-contained, reproducible code.

Petr Pikal
petr.pikal at precheza.cz



More information about the R-help mailing list