In an R script, how do I create a sequence using variables for all parameters? -
In an R script, how do I create a sequence using variables for all parameters? -
it should simple enough, i'm not finding need in documentation. i'm sure don't know for.
i'm new r , have started writing script generate sequence 3 user input variables.
basically, want this
sequence<-seq(1,10,by=2)
to done
seqstart<-readline(prompt="sequence start") seqstop<-readline(prompt="sequence stop") seqint<-readline(prompt="interval") sequence<-seq(seqstart, seqstop, by=seqint)
you need convert result of readline numeric:
seqstart <- as.numeric(readline(prompt="sequence start")) seqstop <- as.numeric(readline(prompt="sequence stop")) seqint <- as.numeric(readline(prompt="interval")) mysequence <- seq(seqstart, seqstop, by=seqint)
r
Comments
Post a Comment