runif.Rmd 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ---
  2. title: "Uniform random number generator example"
  3. output:
  4. BiocStyle::html_document:
  5. toc: true
  6. number_sections: true
  7. highlight: haddock
  8. css: style.css
  9. includes:
  10. in_header: logo.md
  11. liftr:
  12. maintainer: "Tengfei Yin"
  13. maintainer_email: "[email protected]"
  14. from: "rocker/hadleyverse"
  15. latex: false
  16. pandoc: true
  17. params:
  18. seed: 1
  19. n: 1
  20. min: 0
  21. max: 1
  22. rabix:
  23. id: "runif_generator"
  24. label: "random_number"
  25. baseCommand: runif.R
  26. inputs:
  27. - id: "number"
  28. description: "number of observations. If length(n) > 1, the length is taken to be the number required "
  29. type: "integer"
  30. label: "number"
  31. prefix: "--n"
  32. default: 1
  33. required: TRUE
  34. cmdInclude: TRUE
  35. - id: "min"
  36. description: "lower limits of the distribution. Must be finite"
  37. type: "float"
  38. label: "min"
  39. prefix: "--min"
  40. default: 0
  41. - id: "max"
  42. description: "upper limits of the distribution"
  43. type: "float"
  44. label: "max"
  45. prefix: "--max"
  46. default: 1
  47. - id: "seed"
  48. description: "seed with set.seed"
  49. type: "float"
  50. label: "seed"
  51. prefix: "--seed"
  52. default: 1
  53. ---
  54. ```{r style, echo = FALSE, results = 'asis'}
  55. BiocStyle::markdown(css.files = "custom.css")
  56. ```
  57. ## Summary
  58. ```{r}
  59. set.seed(params$seed)
  60. r <- runif(n = as.integer(params$n),
  61. min = as.numeric(params$min),
  62. max = as.numeric(params$max))
  63. summary(r)
  64. hist(r)
  65. ```