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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -