Skip to content

Commit 91689b9

Browse files
Add a new dataset
1 parent f548ba3 commit 91689b9

File tree

9 files changed

+113
-0
lines changed

9 files changed

+113
-0
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ devel
4040
rsconnect/*
4141
rsconnect
4242

43+
data-raw
44+
data-raw/*

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ BugReports: https://github.com/BioDataScience-Course/BioDataScience3/issues
1818
Roxygen: list(markdown = TRUE)
1919
RoxygenNote: 7.1.2
2020
VignetteBuilder: knitr
21+
LazyData: true

R/data.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#' Rice Dataset Commeo and Osmancik
2+
#'
3+
#' A total of 3810 rice grain's images were taken for the two species (Cammeo and Osmancik),
4+
#' processed and feature inferences were made. Seven morphological features were obtained for each grain of rice.
5+
#'
6+
#' @format A data frame with 8 variables and 3810 observations:
7+
#' \describe{
8+
#' \item{\code{area}}{The number of pixels within the boundaries of the rice grain.}
9+
#' \item{\code{perimeter}}{The perimeter of the rice grain.}
10+
#' \item{\code{major_axis_length}}{The longest line that can be drawn on the rice grain.}
11+
#' \item{\code{minor_axis_length}}{The shortest line that can be drawn on the rice grain.}
12+
#' \item{\code{eccentricity}}{It measures how round the ellipse, which has the same moments as the rice grain, is.}
13+
#' \item{\code{convex_area}}{The the pixel count of the smallest convex shell of the region formed by the rice grain.}
14+
#' \item{\code{extent}}{the ratio of the region formed by the rice grain to the bounding box pixels.}
15+
#' \item{\code{class}}{A **factor** with two levels: `"Cammeo"`, and `"Osmancik"`.}
16+
#' }
17+
#' @source {Cinar, I. and Koklu, M. (2019). Classification of Rice Varieties Using Artificial Intelligence Methods. International Journal of Intelligent Systems and Applications in Engineering, vol.7, no.3 (Sep. 2019), pp.188-194. doi:10.18201/ijisae.2019355381}
18+
"rice"

data-raw/rice.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Rice (Cammeo and Osmancik) Data Set
2+
rice <- data.io::read(file = "data-raw/rice.rds")
3+
## rename variable
4+
names(rice) <- tolower(names(rice))
5+
# write data
6+
usethis::use_data(rice, overwrite = TRUE)

data-raw/rice.rds

67.2 KB
Binary file not shown.

data/rice.rda

81.6 KB
Binary file not shown.

inst/translation/rice_en.R

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.rice_en <- function(rice, labels_only = FALSE, as_labelled = FALSE) {
2+
rice <- labelise(rice, self = FALSE,
3+
label = list(
4+
area = "Area",
5+
perimeter = "Perimeter",
6+
major_axis_length = "Major axis length",
7+
minor_axis_length = "Minor axis length",
8+
eccentricity = "Eccentricity",
9+
convex_area = "Convex Area",
10+
extent = "Extent",
11+
class = "Class"),
12+
units = list(
13+
area = "px^2",
14+
perimeter = "px",
15+
major_axis_length = "px",
16+
minor_axis_length = "px",
17+
eccentricity = NA,
18+
convex_area = NA,
19+
extent = NA,
20+
class = NA),
21+
as_labelled = as_labelled)
22+
23+
#if (!isTRUE(labels_only)) {
24+
# Nothing to do
25+
#}
26+
27+
rice
28+
}

inst/translation/rice_fr.R

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.rice_fr <- function(rice, labels_only = FALSE, as_labelled = FALSE) {
2+
rice <- labelise(rice, self = FALSE,
3+
label = list(
4+
area = "Aire",
5+
perimeter = "Perimètre",
6+
major_axis_length = "Longueur de l'axe majeur",
7+
minor_axis_length = "Longueur de l'axe mineur",
8+
eccentricity = "Excentricité",
9+
convex_area = "Aire convexe",
10+
extent = "Extent",
11+
class = "Classe"),
12+
units = list(
13+
area = "px^2",
14+
perimeter = "px",
15+
major_axis_length = "px",
16+
minor_axis_length = "px",
17+
eccentricity = NA,
18+
convex_area = NA,
19+
extent = NA,
20+
class = NA),
21+
as_labelled = as_labelled)
22+
23+
#if (!isTRUE(labels_only)) {
24+
# Nothing to do
25+
#}
26+
27+
rice
28+
}

man/rice.Rd

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)