require(mosaic)

Identifying lazy data and success argument in binom.test() and prop.test() output

# using ggplot2::midwest as an example
binom.test(~category, data=midwest)
prop.test(~category, data=midwest)

Note: For lazy loaded data, using deparse(lazyeval::lazy(data)$expr) doesn't contain what we want, so I'm reverting to using substitute() here.

Error messages that could be improved

favstats error message (#458)

This error message was previously cryptic. Better now.

require(mosaicData)
favstats(~sex, data=HELPrct)

CIAdata()

Adding in ability to select multiple names and get a merged data set.

World <- CIAdata(c("pop", "area", "life", "fert"))
head(World)

Issue 736: xpt() bugs

This was throwing an error because of missing ncp:

suppressPackageStartupMessages(library(mosaic, quietly = TRUE))
xpt(.67, df = 49)

Trouble caused because there is no default for ncp in pt() Indeed

Supplying ncp = 0 uses the algorithm for the non-central distribution, which is not the same algorithm used if ncp is omitted. This is to give consistent behaviour in extreme cases with values of ncp very near zero.

Fixed with explicit test for missing.

Issue 737

... was missing in a couple of function and so xlim (and other things) were not being passed along.

suppressPackageStartupMessages(library(mosaic))
xpt(41.944,df=4, ncp=0, xlim=c(41,43))
xpchisq(41.944,df=4, ncp=0, xlim=c(41,43))
xpf(41.944,df1=4,df2=3, ncp=0, xlim=c(41,43))

qdata() return type

suppressPackageStartupMessages(library(mosaic))
x <- rnorm(100)
qdata(~x, 0.9) %>% class()
qdata(~x, c(0.8, 0.9)) %>% class()
qdata(~x, 0.9)
qdata(~x, c(0.8, 0.9))
cdata(~x, 0.9) %>% class()
cdata(~x, c(0.8, 0.9)) %>% class()
cdata(~x, 0.9)
cdata(~x, c(0.8, 0.9))

Issue 734: pdist() et al not working for hypergeometric dists

Problem was the use of n as a parameter.

suppressPackageStartupMessages(library(mosaic))
pdist("hyper", 4, m = 10, n = 8, k = 7)
phyper(4, m = 10, n = 8, k = 7)

cdata() -- #738

suppressPackageStartupMessages(library(mosaic))
x <- rnorm(100)
qdata(~x, 0.9) %>% class()
qdata(~x, c(0.8, 0.9)) %>% class()
qdata(~x, 0.9)
qdata(~x, c(0.8, 0.9))
cdata(~x, 0.9) %>% class()
cdata(~x, c(0.8, 0.9)) %>% class()
cdata(~x, 0.9)
cdata(~x, c(0.8, 0.9))


ProjectMOSAIC/mosaic documentation built on Feb. 21, 2024, 2:11 a.m.