Skip to content

Commit 59756e6

Browse files
committed
Update pkgdown, add unit tests and doi
1 parent 24c2015 commit 59756e6

File tree

107 files changed

+24880
-2451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+24880
-2451
lines changed

.DS_Store

10 KB
Binary file not shown.

DESCRIPTION

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
Package: BioStatR
22
Type: Package
33
Title: Initiation à La Statistique Avec R
4-
Version: 4.0.1
5-
Date: 2023-03-21
4+
Version: 4.1.0
5+
Date: 2025-09-13
66
Depends: R (>= 2.10)
77
Imports: ggplot2
8+
Suggests: GGally, Hmisc, MASS, OneTwoSamples, TeachingDemos, agricolae,
9+
e1071, gdata, granova, granovaGG, gridExtra, hcci, lattice,
10+
lmPerm, lmtest, multcomp, multcompView, plyr, qcc, reshape,
11+
sandwich, scales, vcd, vdiffr, xlsx, testthat (>= 3.0.0)
812
Authors@R: c(
9-
person(given = "Frederic", family= "Bertrand", role = c("cre", "aut"), email = "frederic.bertrand@utt.fr", comment = c(ORCID = "0000-0002-0837-8281")),
10-
person(given = "Myriam", family= "Maumy-Bertrand", role = c("aut"), email = "myriam.maumy@utt.fr", comment = c(ORCID = "0000-0002-4615-1512")))
13+
person(given = "Frederic", family= "Bertrand", role = c("cre", "aut"), email = "frederic.bertrand@lecnam.net", comment = c(ORCID = "0000-0002-0837-8281")),
14+
person(given = "Myriam", family= "Maumy-Bertrand", role = c("aut"), email = "myriam.maumy@ehesp.fr", comment = c(ORCID = "0000-0002-4615-1512")))
1115
Author: Frederic Bertrand [cre, aut] (<https://orcid.org/0000-0002-0837-8281>), Myriam Maumy-Bertrand [aut] (<https://orcid.org/0000-0002-4615-1512>)
12-
Maintainer: Frederic Bertrand <frederic.bertrand@utt.fr>
16+
Maintainer: Frederic Bertrand <frederic.bertrand@lecnam.net>
1317
Description: Datasets and functions for the book "Initiation à la Statistique avec R", F. Bertrand and M. Maumy-Bertrand (2022, ISBN:978-2100782826 Dunod, fourth edition).
1418
LazyLoad: yes
1519
LazyData: yes
@@ -18,4 +22,5 @@ Encoding: UTF-8
1822
Classification/MSC:
1923
URL: https://fbertran.github.io/BioStatR/, https://github.com/fbertran/BioStatR/
2024
BugReports: https://github.com/fbertran/BioStatR/issues/
21-
RoxygenNote: 7.2.1
25+
RoxygenNote: 7.3.2
26+
Config/testthat/edition: 3

NEWS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# BioStatR 4.1.0
2+
3+
* Maintainer email update
4+
* Added unit tests
5+
* Added package doi
6+
7+
# BioStatR 4.0.2
8+
9+
* A suggest field fix to cope with CRAN requirements about the use of packages in demos.
10+
111
# BioStatR 4.0.1
212

313
* Update links to the webpage of the 4th edition of the book of the package. Update cover page image of the book. Update demo code. A few code fixes to cope with new CRAN requirements.

R/BioStatR-package.R

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
#' BioStatR
2-
#'
3-
#' Motivation: Package compagnon du livre Initiation à la statistique avec R.
4-
#' Il contient les codes des chapitres du livre ainsi que les solutions des
5-
#' exercices mais aussi d'autres compléments à découvrir.
6-
#'
7-
#'
8-
#' @name BioStatR
9-
#' @docType package
1+
#' @keywords internal
2+
#' @aliases BioStatR-package BioStatR NULL
3+
#'
104
#' @references F. Bertrand, M. Maumy-Bertrand, Initiation à la Statistique avec
115
#' R, 4ème édition, ISBN:9782100847945, Dunod, Paris, 2023
126
#' @references \emph{Initiation à la Statistique avec R}, Frédéric Bertrand,
137
#' Myriam Maumy-Bertrand, 2023, ,
148
#' \url{https://www.dunod.com/sciences-techniques/initiation-statistique-avec-r-cours-exemples-exercices-et-problemes-corriges-1},
159
#' \url{https://github.com/fbertran/BioStatR/} et
1610
#' \url{https://fbertran.github.io/BioStatR/}
17-
#'
11+
#'
12+
"_PACKAGE"
13+
1814
#' @importFrom grDevices colorRampPalette gray
1915
#' @importFrom graphics hist par persp rect
2016
#' @importFrom stats as.formula lm qchisq qf qnorm quantile sd
2117
#' @import ggplot2
2218
#'
23-
#' @examples
24-
#' set.seed(314)
25-
#'
2619
NULL
2720

2821

R/binom.ci.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
#' "Wilson", intervalle "exact" de Clopper-Pearson, intervalle asymptotique de
1212
#' "Wald" ou tous les trois "all"
1313
#' @return \item{matrix}{Limites des intervalles de confiance demandés.}
14-
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@utt.fr}\cr
15-
#' \url{http://www-irma.u-strasbg.fr/~fbertran/}\cr
14+
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@lecnam.net}\cr
15+
#' \url{https://fbertran.github.io/homepage/}\cr
1616
#' Maumy-Bertrand\cr \email{myriam.maumy@@utt.fr}\cr
17-
#' \url{http://www-irma.u-strasbg.fr/~mmaumy/}
17+
#' \url{https://www.ehesp.fr/annuaire/enseignement-recherche/myriam-maumy/}
1818
#' @seealso \code{\link{binom.test}}, \code{\link{binom.ci}},
1919
#' \code{\link{poi.ci}}
2020
#' @references F. Bertrand, M. Maumy-Bertrand, Initiation à la Statistique avec

R/cvar.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#'
88
#' @param x Un vecteur numérique
99
#' @return \item{num}{Valeur du coefficient de variation exprimé en pourcents}
10-
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@utt.fr}\cr
11-
#' \url{http://www-irma.u-strasbg.fr/~fbertran/}\cr
10+
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@lecnam.net}\cr
11+
#' \url{https://fbertran.github.io/homepage/}\cr
1212
#' Maumy-Bertrand\cr \email{myriam.maumy@@utt.fr}\cr
13-
#' \url{http://www-irma.u-strasbg.fr/~mmaumy/}
13+
#' \url{https://www.ehesp.fr/annuaire/enseignement-recherche/myriam-maumy/}
1414
#' @seealso \code{\link{mean}}, \code{\link{sd}}
1515
#' @references F. Bertrand, M. Maumy-Bertrand, Initiation à la Statistique avec
1616
#' R, Dunod, 4ème édition, 2023.

R/eta2.R

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
#' @param x Un vecteur associé à la variable quantitative
99
#' @param y Un facteur associé à la variable qualitative
1010
#' @return \item{num}{La valeur du rapport de corrélation empirique}
11-
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@utt.fr}\cr
12-
#' \url{http://www-irma.u-strasbg.fr/~fbertran/}\cr
13-
#' Maumy-Bertrand\cr \email{myriam.maumy@@utt.fr}\cr
14-
#' \url{http://www-irma.u-strasbg.fr/~mmaumy/}
11+
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@lecnam.net}\cr
12+
#' \url{https://fbertran.github.io/homepage/}\cr
13+
#' Maumy-Bertrand\cr \email{myriam.maumy@@ehesp.fr}\cr
14+
#' \url{https://www.ehesp.fr/annuaire/enseignement-recherche/myriam-maumy/}
1515
#' @references F. Bertrand, M. Maumy-Bertrand, Initiation à la Statistique avec
1616
#' R, Dunod, 4ème édition, 2023.
1717
#' @keywords univar
@@ -21,5 +21,8 @@
2121
#'
2222
#' @export eta2
2323
eta2 <- function(x,y) {
24-
return(summary(lm(as.formula(x~y)))$r.squared)
24+
if (!is.factor(y)) {
25+
stop("`y` must be a factor (qualitative variable) for eta2().", call. = FALSE)
26+
}
27+
return(summary(lm(as.formula(x~y)))$r.squared)
2528
}

R/gg_qqplot.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
#' Affiche les valeurs des quartiles théoriques par lesquels passe la droite
2525
#' ainsi que son ordonnée à l'origine et sa pente si le tracé de celle-ci est
2626
#' demandé.}
27-
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@utt.fr}\cr
28-
#' \url{http://www-irma.u-strasbg.fr/~fbertran/}\cr
29-
#' Maumy-Bertrand\cr \email{myriam.maumy@@utt.fr}\cr
30-
#' \url{http://www-irma.u-strasbg.fr/~mmaumy/}
27+
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@lecnam.net}\cr
28+
#' \url{https://fbertran.github.io/homepage/}\cr
29+
#' Maumy-Bertrand\cr \email{myriam.maumy@@ehesp.fr}\cr
30+
#' \url{https://www.ehesp.fr/annuaire/enseignement-recherche/myriam-maumy/}
3131
#' @seealso \code{\link{qqplot}}, \code{\link{qqline}}
3232
#' @references F. Bertrand, M. Maumy-Bertrand, Initiation à la Statistique avec
3333
#' R, Dunod, 3e, 2018.
@@ -74,10 +74,11 @@ gg_qqplot <- function(df,var,qdist=qnorm,params=list(),qq.line=TRUE,color="red",
7474
slope <- diff(y)/diff(x)
7575
int <- y[1L] - slope * x[1L]
7676
}
77-
p <- ggplot2::ggplot(df, aes_string(sample=var)) + ggplot2::stat_qq(alpha = alpha,distribution=qdist,dparams=params)
77+
p <- ggplot2::ggplot(df, aes(sample = .data[[var]])) + ggplot2::stat_qq(alpha = alpha,distribution=qdist,dparams=params)
7878
if(qq.line){
7979
p <- p + ggplot2::geom_abline(slope = slope, intercept = int, color=color)
8080
cat(paste(c("1st quartile : ",x[1],"\n3rd quartile : ",x[2],"\nIntercept : ",int,"\nSlope : ",slope,"\n"),sep=""))
8181
}
8282
return(p)
8383
}
84+

R/panel.hist.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#' @param x Un vecteur numérique
88
#' @param \dots Des arguments à transmettre à la fonction qui créé les
99
#' histogrammes
10-
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@utt.fr}\cr
11-
#' \url{http://www-irma.u-strasbg.fr/~fbertran/}\cr
12-
#' Maumy-Bertrand\cr \email{myriam.maumy@@utt.fr}\cr
13-
#' \url{http://www-irma.u-strasbg.fr/~mmaumy/}
10+
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@lecnam.net}\cr
11+
#' \url{https://fbertran.github.io/homepage/}\cr
12+
#' Maumy-Bertrand\cr \email{myriam.maumy@@ehesp.fr}\cr
13+
#' \url{https://www.ehesp.fr/annuaire/enseignement-recherche/myriam-maumy/}
1414
#' @seealso \code{\link{pairs}}, \code{\link{hist}}
1515
#' @references F. Bertrand, M. Maumy-Bertrand, Initiation à la Statistique avec
1616
#' R, Dunod, 4ème édition, 2023.
@@ -23,10 +23,11 @@
2323
#' @export panel.hist
2424
panel.hist <- function(x, ...)
2525
{
26-
usr <- par("usr"); on.exit(par(usr))
26+
usr <- par("usr"); on.exit(par("usr"))
2727
par(usr = c(usr[1:2], 0, 1.5) )
2828
h <- hist(x, plot = FALSE)
2929
breaks <- h$breaks; nB <- length(breaks)
3030
y <- h$counts; y <- y/max(y)
31-
rect(breaks[-nB], 0, breaks[-1], y, col="cyan", ...)
31+
rect(xleft=breaks[-nB], ybottom=0, xright=breaks[-1],
32+
ytop=y, col="cyan", ...)
3233
}

R/plotcdf2.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
#' gris "bw"
2222
#' @return Un stéréogramme des deux séries statistiques groupées ou des deux
2323
#' variables discrètes étudiées.
24-
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@utt.fr}\cr
25-
#' \url{http://www-irma.u-strasbg.fr/~fbertran/}\cr
24+
#' @author Frédéric Bertrand\cr \email{frederic.bertrand@@lecnam.net}\cr
25+
#' \url{https://fbertran.github.io/homepage/}\cr
2626
#' Maumy-Bertrand\cr \email{myriam.maumy@@utt.fr}\cr
27-
#' \url{http://www-irma.u-strasbg.fr/~mmaumy/}
27+
#' \url{https://www.ehesp.fr/annuaire/enseignement-recherche/myriam-maumy/}
2828
#' @references F. Bertrand, M. Maumy-Bertrand, Initiation à la Statistique avec
2929
#' R, Dunod, 4ème édition, 2023.
3030
#' @keywords univar

0 commit comments

Comments
 (0)