Hi All,

I need a basic help from you. I've built a function like this,

windowlength<-function(x)
{
z <- rep(seq(0,331,by=x-1)+1, each=2)                      
zz <- z[-c(1,length(z))]                                   
ind <- as.data.frame(matrix(zz, nr=2))                     
j<-lapply(ind, function(x) mat[x[1]:x[2],])                
cat("For",x/4,"month number of windows is = ",length(ind),"\n")
}
windowlength(x=12)

I need to know how can i give command in "R" so that instead of giving the last line, i.e "R" will ask the user to give the value of x? I mean to say,
1) It will ask user "Give the value of x"
2) Then user inputs 12, and R gives the ultimate result.

Thanks,
Sumanta Basak.

				
---------------------------------
 What makes Sachin India's highest paid sports celebrity?, Share your knowledge on Yahoo! India Answers
 Send instant messages to your online friends - NOW
	[[alternative HTML version deleted]]

