Evaluate expression n times then combine results into a data frame
rdply(.n, .expr, .progress = "none", .id = NA)
.n | number of times to evaluate the expression |
---|---|
.expr | expression to evaluate |
.progress | name of the progress bar to use, see
|
.id | name of the index column. Pass |
a data frame
This function runs an expression multiple times, and combines the result into
a data frame. If there are no results, then this function returns a data
frame with zero rows and columns (data.frame()
). This function is
equivalent to replicate
, but will always return results as a
data frame.
Hadley Wickham (2011). The Split-Apply-Combine Strategy for Data Analysis. Journal of Statistical Software, 40(1), 1-29. http://www.jstatsoft.org/v40/i01/.
#> .n V1 #> 1 1 0.4836436 #> 2 2 0.4799288 #> 3 3 0.4783763 #> 4 4 0.4661561 #> 5 5 0.5193975 #> 6 6 0.4826382 #> 7 7 0.4853779 #> 8 8 0.5033093 #> 9 9 0.5436864 #> 10 10 0.5370971 #> 11 11 0.5527163 #> 12 12 0.5311481 #> 13 13 0.4714964 #> 14 14 0.5445611 #> 15 15 0.5348261 #> 16 16 0.5191539 #> 17 17 0.5051741 #> 18 18 0.5046961 #> 19 19 0.4912406 #> 20 20 0.4951647#> .n mean var #> 1 1 0.4959134 0.09544314 #> 2 2 0.5327163 0.08448444 #> 3 3 0.5004168 0.09229451 #> 4 4 0.5050083 0.08060376 #> 5 5 0.4887997 0.08813860 #> 6 6 0.5287587 0.08785057 #> 7 7 0.4687391 0.06609100 #> 8 8 0.5024661 0.09130735 #> 9 9 0.5375696 0.07506986 #> 10 10 0.4911553 0.09991435 #> 11 11 0.5305912 0.09428006 #> 12 12 0.5042991 0.09284471 #> 13 13 0.4733392 0.07500645 #> 14 14 0.5335691 0.09423053 #> 15 15 0.4964951 0.07716722 #> 16 16 0.4655572 0.09399317 #> 17 17 0.5125365 0.07466841 #> 18 18 0.5391303 0.08478118 #> 19 19 0.4733673 0.06991162 #> 20 20 0.5367983 0.07694283#> .n x #> 1 1 0.11080562 #> 2 1 0.45940211 #> 3 2 0.66353209 #> 4 2 0.57198812 #> 5 3 0.59525637 #> 6 3 0.20911521 #> 7 4 0.66956041 #> 8 4 0.49112037 #> 9 5 0.69588151 #> 10 5 0.64594813 #> 11 6 0.75810868 #> 12 6 0.43120516 #> 13 7 0.69651659 #> 14 7 0.21022653 #> 15 8 0.14072162 #> 16 8 0.15714079 #> 17 9 0.68212874 #> 18 9 0.48151583 #> 19 10 0.66666017 #> 20 10 0.87981722 #> 21 11 0.89144040 #> 22 11 0.25595099 #> 23 12 0.86164285 #> 24 12 0.27330167 #> 25 13 0.34253370 #> 26 13 0.10788219 #> 27 14 0.88664160 #> 28 14 0.74232748 #> 29 15 0.76179493 #> 30 15 0.07399478 #> 31 16 0.34894525 #> 32 16 0.16098949 #> 33 17 0.72017991 #> 34 17 0.88904095 #> 35 18 0.03013248 #> 36 18 0.45054664 #> 37 19 0.24646247 #> 38 19 0.72652932 #> 39 20 0.33401874 #> 40 20 0.42803925