Reputation: 55
I want to create a list with 1000 files including all just containing the value 20 (7 times).
For example
[1] 20 20 20 20 20 20 20
[2] 20 20 20 20 20 20 20
...
[1000] 20 20 20 20 20 20 20
result = list(rep(20,7))
This way I just create one list.
result = as.list(rep(20,1000))
And this way I create 1000 lists containing just one entry. I tried to implement two "rep" functions. For example
result = as.list(rep(rep(20,7), 1000))
But unfortunately it does not work.
Upvotes: 0
Views: 32
Reputation: 173627
Something like this, perhaps:
x <- replicate(1000,rep(20,7),simplify = FALSE)
Upvotes: 2