Skip to content

Commit

Permalink
Add datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed Aug 5, 2024
1 parent a09f67c commit 4997f6f
Show file tree
Hide file tree
Showing 20 changed files with 484 additions and 50 deletions.
140 changes: 114 additions & 26 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,88 @@
#' Hongite Mineralogy
#'
#' Mineral compositions of 25 specimens of hongite.
#' @format A [`data.frame`] with 5 variables (minerals):
#' \describe{
#' \item{`A`}{Albite (weight percent).}
#' \item{`B`}{Blandite (weight percent).}
#' \item{`C`}{Cornite (weight percent).}
#' \item{`D`}{Daubite (weight percent).}
#' \item{`E`}{Endite (weight percent).}
#' }
#' @references
#' Aitchison, J. (1986). *The Statistical Analysis of Compositional Data*.
#' London: Chapman and Hall.
#' @family datasets
#' @keywords datasets
"hongite"

#' Kongite Mineralogy
#'
#' Mineral compositions of 25 specimens of kongite.
#' @format A [`data.frame`] with 5 variables (minerals):
#' \describe{
#' \item{`A`}{Albite (weight percent).}
#' \item{`B`}{Blandite (weight percent).}
#' \item{`C`}{Cornite (weight percent).}
#' \item{`D`}{Daubite (weight percent).}
#' \item{`E`}{Endite (weight percent).}
#' }
#' @references
#' Aitchison, J. (1986). *The Statistical Analysis of Compositional Data*.
#' London: Chapman and Hall.
#' @family datasets
#' @keywords datasets
"kongite"

#' Boxite Mineralogy
#'
#' Mineral compositions and depths of 25 specimens of boxite.
#' @format A [`data.frame`] with 5 variables (minerals):
#' \describe{
#' \item{`A`}{Albite (weight percent).}
#' \item{`B`}{Blandite (weight percent).}
#' \item{`C`}{Cornite (weight percent).}
#' \item{`D`}{Daubite (weight percent).}
#' \item{`E`}{Endite (weight percent).}
#' \item{`depth`}{Depth (meter).}
#' }
#' @references
#' Aitchison, J. (1986). *The Statistical Analysis of Compositional Data*.
#' London: Chapman and Hall.
#' @family datasets
#' @keywords datasets
"boxite"

#' Coxite Mineralogy
#'
#' Mineral compositions, depths and porosity of 25 specimens of coxite.
#' @format A [`data.frame`] with 5 variables (minerals):
#' \describe{
#' \item{`A`}{Albite (weight percent).}
#' \item{`B`}{Blandite (weight percent).}
#' \item{`C`}{Cornite (weight percent).}
#' \item{`D`}{Daubite (weight percent).}
#' \item{`E`}{Endite (weight percent).}
#' \item{`depth`}{Depth (meter).}
#' \item{`porosity`}{Porosity (percent).}
#' }
#' @references
#' Aitchison, J. (1986). *The Statistical Analysis of Compositional Data*.
#' London: Chapman and Hall.
#' @family datasets
#' @keywords datasets
"coxite"

#' Arctic Lake
#'
#' Sand, silt, clay compositions of 39 sediment samples at different water
#' depths in an Arctic lake.
#' @format A [`data.frame`] with 4 variables:
#' \describe{
#' \item{sand}{Sand content (percent).}
#' \item{silt}{Silt content (percent).}
#' \item{clay}{Clay content (percent).}
#' \item{depth}{Water depth (m).}
#' \item{`sand`}{Sand content (percent).}
#' \item{`silt`}{Silt content (percent).}
#' \item{`clay`}{Clay content (percent).}
#' \item{`depth`}{Water depth (m).}
#' }
#' @references
#' Aitchison, J. (1986). *The Statistical Analysis of Compositional Data*.
Expand All @@ -16,39 +91,52 @@
#' @keywords datasets
"arctic"

#' Hongite Mineralogy
#' Skye Lavas Compositions
#'
#' Mineral compositions of 25 rock specimens of hongite type.
#' @format A [`data.frame`] with 5 variables (minerals):
#' Chemical compositions of 23 aphyric Skye lavas.
#' @format A [`data.frame`] with 3 variables (percent):
#' \describe{
#' \item{A}{Albite (percent).}
#' \item{B}{Blandite (percent).}
#' \item{C}{Cornite (percent).}
#' \item{D}{Daubite (percent).}
#' \item{E}{Endite (percent).}
#' \item{`A`}{Na2O + K2O.}
#' \item{`F`}{Fe2O3.}
#' \item{`M`}{MgO.}
#' }
#' @references
#' @source
#' Aitchison, J. (1986). *The Statistical Analysis of Compositional Data*.
#' London: Chapman and Hall.
#' London: Chapman and Hall. \doi{10.1007/978-94-009-4109-0}.
#' @family datasets
#' @keywords datasets
"hongite"
"lava"

#' Predator-Prey Compositions
#'
#' Predator-prey compositions at 25 different sites.
#' @format A [`data.frame`] with 3 variables (proportions):
#' \describe{
#' \item{`P`}{Predator.}
#' \item{`Q`}{Prey of species Q.}
#' \item{`R`}{Prey of species R.}
#' }
#' @source
#' Aitchison, J. (1986). *The Statistical Analysis of Compositional Data*.
#' London: Chapman and Hall. \doi{10.1007/978-94-009-4109-0}.
#' @family datasets
#' @keywords datasets
"predator"

#' Thin Sections
#' Thin Sections Compositions
#'
#' Mineral compositions of five slides as reported by five analysts.
#' @format A [`data.frame`] with 9 variables:
#' \describe{
#' \item{analyst}{Analyst number.}
#' \item{slide}{Slide number.}
#' \item{quartz}{Quartz (percent).}
#' \item{microcline}{Microcline (percent).}
#' \item{plagioclass}{Plagioclass (percent).}
#' \item{biotite}{Biotite (percent).}
#' \item{plagioclass}{Plagioclass (percent).}
#' \item{muscovite}{Muscovite (percent).}
#' \item{opaques}{Opaque minerals (percent).}
#' \item{nonopaques}{Non-opaque minerals (percent).}
#' \item{`analyst`}{Analyst number.}
#' \item{`slide`}{Slide number.}
#' \item{`quartz`}{Quartz (percent).}
#' \item{`microcline`}{Microcline (percent).}
#' \item{`plagioclass`}{Plagioclass (percent).}
#' \item{`biotite`}{Biotite (percent).}
#' \item{`muscovite`}{Muscovite (percent).}
#' \item{`opaques`}{Opaque minerals (percent).}
#' \item{`nonopaques`}{Non-opaque minerals (percent).}
#' }
#' @references
#' Aitchison, J. (1986). *The Statistical Analysis of Compositional Data*.
Expand Down
19 changes: 17 additions & 2 deletions data-raw/DATASET.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
## Data from Aitchison (1986)
hongite <- read.csv("data-raw/hongite.csv", header = TRUE, row.names = 1)
usethis::use_data(hongite, overwrite = FALSE)

kongite <- read.csv("data-raw/kongite.csv", header = TRUE, row.names = 1)
usethis::use_data(kongite, overwrite = FALSE)

boxite <- read.csv("data-raw/boxite.csv", header = TRUE, row.names = 1)
usethis::use_data(boxite, overwrite = FALSE)

coxite <- read.csv("data-raw/coxite.csv", header = TRUE, row.names = 1)
usethis::use_data(coxite, overwrite = FALSE)

arctic <- read.csv("data-raw/arctic.csv", header = TRUE, row.names = 1)
usethis::use_data(arctic, overwrite = FALSE)

hongite <- read.csv("data-raw/hongite.csv", header = TRUE, row.names = 1)
usethis::use_data(hongite, overwrite = FALSE)
lava <- read.csv("data-raw/lava.csv", header = TRUE, row.names = 1)
usethis::use_data(lava, overwrite = FALSE)

predator <- read.csv("data-raw/predator.csv", header = TRUE, row.names = 1)
usethis::use_data(predator, overwrite = FALSE)

slides <- read.csv("data-raw/slides.csv", header = TRUE, row.names = NULL)
usethis::use_data(slides, overwrite = FALSE)
26 changes: 26 additions & 0 deletions data-raw/boxite.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
,A,B,C,D,E,depth
B1,43.5,25.1,14.7,10.0,6.7,1
B2,41.1,27.5,13.9,9.5,8.0,2
B3,41.5,20.1,20.6,11.1,6.7,3
B4,33.9,37.8,11.1,11.5,5.7,4
B5,46.5,16.0,15.6,14.3,7.6,5
B6,45.3,19.4,14.8,13.5,9.3,6
B7,33.2,25.2,15.2,17.1,9.3,7
B8,40.8,15.1,21.7,14.6,7.8,8
B9,33.0,30.8,15.1,12.9,8.2,9
B10,28.2,38.6,12.1,14.1,6.9,10
B11,33.9,31.5,15.4,12.0,7.2,11
B12,48.7,19.3,13.4,10.7,7.9,12
B13,37.8,37.1,10.4,8.6,6.1,13
B14,42.0,26.6,13.7,10.5,7.2,14
B15,44.2,26.5,12.9,9.6,6.8,15
B16,39.7,23.2,20.6,10.2,6.3,16
B17,39.3,28.1,13.0,13.6,6.0,17
B18,34.1,26.7,13.6,17.0,8.6,18
B19,36.2,35.3,11.2,11.9,5.4,19
B20,39.5,36.0,9.4,8.4,6.7,20
B21,39.5,22.5,18.7,11.4,7.9,21
B22,33.0,33.5,17.7,9.8,6.0,22
B23,42.3,16.6,16.9,17.0,7.2,23
B24,39.9,19.0,13.4,21.3,6.4,24
B25,37.8,30.9,11.9,12.9,6.5,25
26 changes: 26 additions & 0 deletions data-raw/coxite.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
,A,B,C,D,E,depth,porosity
C1,44.2,31.9,5.4,10.5,8.0,1,21.8
C2,49.0,25.4,5.8,11.3,8.5,2,25.2
C3,50.2,24.8,5.7,11.1,8.2,3,26.1
C4,49.9,24.7,5.4,11.4,8.6,4,26.3
C5,48.5,27.8,5.9,10.2,7.6,5,22.6
C6,45.9,27.1,6.9,11.5,8.6,6,21.4
C7,44.1,31.9,6.0,10.2,7.8,7,22.0
C8,46.4,29.9,5.5,10.3,7.9,8,22.0
C9,45.7,27.0,6.2,12.0,9.1,9,23.1
C1O,46.4,30.0,5.1,10.4,8.1,10,24.0
C11,41.7,30.2,7.7,11.6,8.8,11,18.4
C12,44.9,25.7,7.7,12.4,9.3,12,20.5
C13,48.6,27.7,5.8,10.2,7.7,13,22.9
C14,49.7,26.7,4.9,10.6,8.1,14,27.2
C15,49.6,24.4,6.4,11.2,8.4,15,23.4
C16,46.5,28.6,5.9,10.7,8.3,16,22.5
C17,47.3,24.2,7.9,11.8,8.8,17,21.6
C18,44.7,30.0,6.8,10.5,8.0,18,20.5
C19,48.0,25.6,7.0,11.1,8.3,19,22.7
C20,50.0,23.8,6.6,11.2,8.4,20,23.7
C21,51.4,24.2,5.7,10.7,8.0,21,26.2
C22,53.3,25.1,5.2,9.4,7.0,22,26.4
C23,47.9,25.4,6.7,11.4,8.6,23,22.2
C24,43.5,29.8,6.7,11.2,8.8,24,19.5
C25,44.5,29.2,6.5,11.2,8.6,25,21.3
26 changes: 26 additions & 0 deletions data-raw/kongite.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
,A,B,C,D,E
K1,33.5,6.1,41.3,7.1,12.0
K2,47.6,14.9,16.1,14.8,6.6
K3,52.7,23.9,6.0,8.7,8.7
K4,44.5,24.2,10.7,11.9,8.7
K5,42.3,47.6,0.6,4.1,5.4
K6,51.8,33.2,1.9,7.0,6.1
K7,47.9,21.5,10.7,9.5,10.4
K8,51.2,23.6,6.2,13.3,5.7
K9,19.3,2.3,65.8,5.8,6.8
K10,46.1,23.4,10.4,11.5,8.6
K11,30.6,6.7,43.0,6.3,13.4
K12,49.7,28.1,5.1,8.0,9.1
K13,49.4,24.3,7.6,8.5,10.2
K14,38.4,9.5,30.6,14.8,6.7
K15,41.6,19.0,17.3,13.8,8.3
K16,42.3,43.3,1.6,5.9,6.9
K17,45.7,23.9,10.3,11.6,8.5
K18,45.5,20.3,13.6,10.9,9.7
K19,52.1,17.9,10.7,7.9,11.4
K20,46.2,14.3,18.5,12.2,8.8
K21,47.2,30.9,4.6,6.3,11.0
K22,45.4,33.3,4.0,11.9,5.4
K23,48.6,23.4,8.7,10.7,8.6
K24,31.2,4.5,47.0,10.2,7.1
K25,44.3,15.0,19.4,10.5,10.8
24 changes: 24 additions & 0 deletions data-raw/lava.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
,"A","F","M"
"S1",52,42,6
"S2",52,44,4
"S3",47,48,5
"S4",45,49,6
"S5",40,50,10
"S6",37,54,9
"S7",27,58,15
"S8",27,54,19
"S9",23,59,18
"S10",22,59,19
"S11",21,60,19
"S12",25,53,22
"S13",24,54,22
"S14",22,55,23
"S15",22,56,22
"S16",20,58,22
"S17",16,62,22
"S18",17,57,26
"S19",14,54,32
"S20",13,55,32
"S21",13,52,35
"S22",14,47,39
"S23",24,56,20
26 changes: 26 additions & 0 deletions data-raw/predator.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
,P,Q,R
S1,0.123,0.649,0.227
S2,0.218,0.557,0.225
S3,0.072,0.787,0.142
S4,0.103,0.703,0.195
S5,0.158,0.450,0.392
S6,0.257,0.372,0.370
S7,0.129,0.439,0.433
S8,0.120,0.531,0.340
S9,0.096,0.677,0.227
S10,0.131,0.666,0.203
S11,0.241,0.581,0.178
S12,0.134,0.600,0.266
S13,0.184,0.579,0.236
S14,0.053,0.688,0.259
S15,0.106,0.673,0.221
T1,0,0.478,0.522
T2,0,0.583,0.417
T3,0,0.380,0.620
T4,0,0.682,0.318
T5,0,0.628,0.372
T6,0,0.597,0.403
T7,0,0.514,0.486
T8,0,0.563,0.437
T9,0,0.603,0.397
T1O,0,0.775,0.225
Binary file added data/boxite.rda
Binary file not shown.
Binary file added data/coxite.rda
Binary file not shown.
Binary file added data/kongite.rda
Binary file not shown.
Binary file added data/lava.rda
Binary file not shown.
Binary file added data/predator.rda
Binary file not shown.
13 changes: 9 additions & 4 deletions man/arctic.Rd

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

39 changes: 39 additions & 0 deletions man/boxite.Rd

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

Loading

0 comments on commit 4997f6f

Please sign in to comment.