Self Referencing a Grid (Error in seq.default(random_3, 120, 5) : 'from' must be of length 1 >)

I am trying to define a grid in R using the "expand.grid" command:

random_1 <- seq(80,100,5)
random_2 <- seq(random_1,120,5)
random_3 <- seq(85,120,5)
random_4 <- seq(random_3,120,5)
split_1 =  seq(0,1,0.5)
split_2 =  seq(0,1,0.5)
split_3 =  seq(0,1,0.5)
DF_2 <- expand.grid(random_1 , random_2, random_3, random_4, split_1, split_2, split_3)

But this returns the following error:

Error in seq.default(random_3, 120, 5) : 'from' must be of length 1
>

Does anyone know how to fix this error?
Thanks

@swaheera ,

Again this is not a minimal example of your problem, nor is it a full description of the errors.
My advice:

  • before posting check the documentation of the functions you use and especially the documentation of the functions that give you an error. In this case type: ?seq
  • during posting keep to the guideline of this forum

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.