Skip to content

Commit

Permalink
add gait data set
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87723 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
maechler committed Feb 15, 2025
1 parent 2ec482f commit f9e69e5
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 5 deletions.
2 changes: 2 additions & 0 deletions doc/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@

\item The documentation of \code{gamma} and \code{is.numeric} is more
specific, thanks to the contributors of \PR{18677}.

\item New dataset \code{gait} thanks to \I{Heather Turner} and \I{Ella Kaye}.
}
}

Expand Down
Binary file added src/library/datasets/data/gait.rda
Binary file not shown.
57 changes: 57 additions & 0 deletions src/library/datasets/man/gait.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
\name{gait}
\title{Hip and Knee Angle while Walking}
\docType{data}
\alias{gait}
\description{
Hip and knee angle (in degrees) through a 20 point movement cycle for 39 boys.
}
\usage{gait}
\format{
A 3-dimensional array with dimensions \code{c(20, 39, 2)} giving the
\code{"Hip Angle"} and \code{"Knee Angle"} (in degrees) for 39 repetitions of
a 20 point gait cycle (over standardized gait times).
}
\details{
The named components of \code{\link{dimnames}(gait)} are as follows:
\describe{
\item{\code{Time}}{\code{seq(from = 0.025, to = 0.975, by = 0.05)}}
\item{\code{Subject}}{\code{"boy1"}, \code{"boy2"}, ..., \code{"boy39"}}
\item{\code{Variable}}{\code{"Hip Angle"} and \code{"Knee Angle"}}
}
}
\references{
Olshen, R. A., Biden, E. N., Wyatt, M. P., and Sutherland, D. (1989)
Gait Analysis and the Bootstrap.
\emph{Annals of Statistics} \bold{17}, 4, 1419--1440.
\doi{10.1214/AOS/1176347372}

Ramsay, J. O., and Silverman, B. W. (2006)
\emph{Functional Data Analysis}, 2nd ed., New York: Springer.

Ramsay, J. (2023) \emph{fda: Functional Data Analysis}.
R package version 6.1.4, \url{https://CRAN.R-project.org/package=fda}.
}
\source{
In the FDA book (2006), p.8, \emph{\dQuote{The Motion Analysis Laboratory at
Children's Hospital, San Diego, collected these data}}.
}
\note{
This is the version of the data as in the \CRANpkg{fda} package and
corresponding textbooks, but with named dimensions. One record appears to be
duplicated from the original paper, Olshen \emph{et al.} (1989), which
analyses a sample of 38 boys. The \code{gait} dataset has 39 boys but
\code{boy19} and \code{boy26} have identical measurements.
}
\examples{
plot(gait[, 1, ], type = "b",
xlim = range(gait[,,1]), ylim = range(gait[,,2]),
xlab = "Hip Angle", ylab = "Knee Angle", main = "'gait' data : Boy 1")
mtext("all other boys", col = "thistle"); grid()
matlines(gait[, -1, 1], gait[, -1, 2], type = "l", lty = 1, col = adjustcolor("thistle", 1/3))
## The data array, two matrices :
op <- options(width = 128) # on a wide console
aperm(gait, c(2:1, 3))
options(op)
}
\keyword{datasets}
27 changes: 24 additions & 3 deletions tests/Examples/datasets-Ex.Rout.save
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

R Under development (unstable) (2024-11-12 r87322) -- "Unsuffered Consequences"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin24.1.0
R Under development (unstable) (2025-02-15 r87721) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Expand Down Expand Up @@ -2450,6 +2450,27 @@ F-statistic: 4354 on 4 and 34 DF, p-value: < 2.2e-16
>
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
> cleanEx()
> nameEx("gait")
> ### * gait
>
> flush(stderr()); flush(stdout())
>
> ### Name: gait
> ### Title: Hip and Knee Angle while Walking
> ### Aliases: gait
> ### Keywords: datasets
>
> ### ** Examples
>
> plot(gait[, 1, ], type = "b",
+ xlim = range(gait[,,1]), ylim = range(gait[,,2]),
+ xlab = "Hip Angle", ylab = "Knee Angle", main = "'gait' data : Boy 1")
> mtext("all other boys", col = "thistle"); grid()
> matlines(gait[, -1, 1], gait[, -1, 2], type = "l", lty = 1, col = adjustcolor("thistle", 1/3))
>
>
>
> cleanEx()
> nameEx("infert")
> ### * infert
>
Expand Down
11 changes: 9 additions & 2 deletions tests/datasets.Rout.save
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

R Under development (unstable) (2024-11-12 r87322) -- "Unsuffered Consequences"
Copyright (C) 2024 The R Foundation for Statistical Computing
R Under development (unstable) (2025-02-15 r87721) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
Expand Down Expand Up @@ -447,6 +447,13 @@ List of 3
** structure of dataset freeny.y
Time-Series [1:39] from 1962 to 1972: 8.79 8.79 8.81 8.81 8.91 ...

** structure of dataset gait
num [1:20, 1:39, 1:2] 37 36 33 29 23 18 15 12 9 6 ...
- attr(*, "dimnames")=List of 3
..$ Time : chr [1:20] "0.025" "0.075" "0.125" "0.175" ...
..$ Subject : chr [1:39] "boy1" "boy2" "boy3" "boy4" ...
..$ Variable: chr [1:2] "Hip Angle" "Knee Angle"

** structure of dataset infert
'data.frame': 248 obs. of 8 variables:
$ education : Factor w/ 3 levels "0-5yrs","6-11yrs",..: 1 1 1 1 2 2 2 2 2 2 ...
Expand Down

0 comments on commit f9e69e5

Please sign in to comment.