Top "Replicate" questions

Create list of single item repeated N times

I want to create a series of lists, all of varying lengths. Each list will contain the same element e, …

python list-comprehension multiplication replicate
Create sequence of repeated values, in sequence?

I need a sequence of repeated numbers, i.e. 1 1 ... 1 2 2 ... 2 3 3 ... 3 etc. The way I implemented this was: nyear <- 20 names &…

r repeat seq replicate
Repeat each row of data.frame the number of times specified in a column

df <- data.frame(var1 = c('a', 'b', 'c'), var2 = c('d', 'e', 'f'), freq = 1:3) What is the simplest …

r dataframe replicate
How to duplicate a MySQL database on the same server

I have a large MySQL database, lets call it live_db, which I want to replicate on the same machine …

mysql database sync replicate
Repeating a repeated sequence

We want to get an array that looks like this: 1,1,1,2,2,2,3,3,3,4,4,4,1,1,1,2,2,2,3,3,3,4,4,4,1,1,1,2,2,2,3,3,3,4,4,4 What is the easiest way to do it?

r sequence replicate
How do you fix a bug you can't replicate?

The question says it all. If you have a bug that multiple users report, but there is no record of …

debugging replicate
replicate function in R returns NULL

I am confused about the output from the replicate function in R, I am trying to use it in two …

r replicate
Repeating a user-defined function using replicate() or sapply()

I have defined a custom function, like this: my.fun = function() { for (i in 1:1000) { ... for (j in 1:20) { ... } } return(output) } which …

r sapply replicate
How to run a function multiple times and write the results to a list?

I have a function that creates a matrix and I want to call this function a thousand times such that …

r list matrix replicate