Skip to content

Commit

Permalink
addressed issues (see news)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvietto committed Jan 31, 2025
1 parent 87c4c6e commit 2bfe74d
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 24 deletions.
35 changes: 19 additions & 16 deletions R/distributions.R
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
distributions <- list(
small = function() { # using a function keeps values mutable, allowing set.seed to work
small = function() {
data.frame(
norm = rnorm(n = 100, mean = 50, sd = 15),
norm2 = rnorm(n = 100, mean = 60, sd = 10), # Smaller spread normal dist
norm3 = rnorm(n = 100, mean = 40, sd = 20), # Larger spread normal dist
binom = rbinom(n = 100, size = 1, prob = 0.20),
norm_2 = rnorm(n = 100, mean = 60, sd = 10),
norm_3 = rnorm(n = 100, mean = 40, sd = 20),
binom = rbinom(n = 100, size = 1, prob = runif(n = 100, min = 0, max = 1)),
neg = rnbinom(n = 100, size = 1, prob = 0.50),
pois = rpois(n = 100, lambda = 3),
exp = rexp(n = 100, rate = 0.10),
unif = runif(n = 100, min = 0, max = 1),
beta = rbeta(n = 100, shape1 = 2, shape2 = 5),
gamma = rgamma(n = 100, shape = 2, scale = 2),
chisq = rchisq(n = 100, df = 2),
t_dist = rt(n = 100, df = 10)
chi_sq = rchisq(n = 100, df = 2),
t_dist = rt(n = 100, df = 10),
f_dist =rf(n = 100, df1 = 10, df2 = 10)
)
},
medium = function() {
data.frame(
norm = rnorm(n = 1000, mean = 50, sd = 15),
norm2 = rnorm(n = 1000, mean = 60, sd = 10),
norm3 = rnorm(n = 1000, mean = 40, sd = 20),
binom = rbinom(n = 1000, size = 1, prob = 0.20),
norm_2 = rnorm(n = 1000, mean = 60, sd = 10),
norm_3 = rnorm(n = 1000, mean = 40, sd = 20),
binom = rbinom(n = 1000, size = 1, prob = runif(n = 1000, min = 0, max = 1)),
neg = rnbinom(n = 1000, size = 1, prob = 0.50),
pois = rpois(n = 1000, lambda = 3),
exp = rexp(n = 1000, rate = 0.10),
unif = runif(n = 1000, min = 0, max = 1),
beta = rbeta(n = 1000, shape1 = 2, shape2 = 5),
gamma = rgamma(n = 1000, shape = 2, scale = 2),
chisq = rchisq(n = 1000, df = 5),
t_dist = rt(n = 1000, df = 20)
chi_sq = rchisq(n = 1000, df = 5),
t_dist = rt(n = 1000, df = 20),
f_dist =rf(n = 1000, df1 = 10, df2 = 10)
)
},
large = function() {
data.frame(
norm = rnorm(n = 10000, mean = 50, sd = 15),
norm2 = rnorm(n = 10000, mean = 60, sd = 10),
norm3 = rnorm(n = 10000, mean = 40, sd = 20),
binom = rbinom(n = 10000, size = 1, prob = 0.20),
norm_2 = rnorm(n = 10000, mean = 60, sd = 10),
norm_3 = rnorm(n = 10000, mean = 40, sd = 20),
binom = rbinom(n = 10000, size = 1, prob = runif(n = 10000, min = 0, max = 1)),
neg = rnbinom(n = 10000, size = 1, prob = 0.50),
pois = rpois(n = 10000, lambda = 3),
exp = rexp(n = 10000, rate = 0.10),
unif = runif(n = 10000, min = 0, max = 1),
beta = rbeta(n = 10000, shape1 = 2, shape2 = 5),
gamma = rgamma(n = 10000, shape = 2, scale = 2),
chisq = rchisq(n = 10000, df = 10),
t_dist = rt(n = 10000, df = 30)
chi_sq = rchisq(n = 10000, df = 10),
t_dist = rt(n = 10000, df = 30),
f_dist =rf(n = 10000, df1 = 10, df2 = 10)
)
}
)
9 changes: 5 additions & 4 deletions R/samplezoo.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
#' @details
#' The distributions included in each data frame are:
#' - `norm`: Normal distribution with mean and standard deviation parameters.
#' - `norm2`: Slight variation of the normal distribution.
#' - `norm3`: Another slight variation of the normal distribution.
#' - `binom`: Binomial (Bernoulli) distribution.
#' - `norm_2`: Slight variation of the normal distribution.
#' - `norm_3`: Another slight variation of the normal distribution.
#' - `binom`: Binomial distribution.
#' - `neg`: Negative binomial distribution.
#' - `pois`: Poisson distribution.
#' - `exp`: Exponential distribution.
#' - `unif`: Uniform distribution.
#' - `beta`: Beta distribution.
#' - `gamma`: Gamma distribution.
#' - `chisq`: Chi-squared distribution.
#' - `chi_sq`: Chi-squared distribution.
#' - `t_dist`: Student's t-distribution.
#' - `f_dist`: F-distribution.
#' @export
#' @examples
#' small_data <- samplezoo("small")
Expand Down
12 changes: 12 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## Minor Update

In this update I have:

* Added support for the F distribution.

* Fixed incorrect binomial aliases in the documentation.

* Introduced a variability parameter to the binomial distribution.

* Corrected notation errors (e.g., norm2 instead of norm_2)

## R CMD check results

0 errors | 0 warnings | 0 note
Binary file added man/figures/README-pressure-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions man/samplezoo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions samplezoo.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 053bde2d-6c5b-4af1-ba7f-2055d8384156

RestoreWorkspace: No
SaveWorkspace: No
Expand Down

0 comments on commit 2bfe74d

Please sign in to comment.