Skip to content

Commit

Permalink
add id variable to circle_example data set
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt committed Nov 13, 2021
1 parent 2af31ce commit 8d41d1f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
3 changes: 2 additions & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
#' A random dataset with two classes one of which is inside a circle. Used for
#' examples to show how the different methods handles borders.
#'
#' @format A data frame with 200 rows and 3 variables:
#' @format A data frame with 200 rows and 4 variables:
#' \describe{
#' \item{x}{Numeric.}
#' \item{y}{Numeric.}
#' \item{class}{Factor, values "Circle" and "Rest".}
#' \item{id}{character, ID variable.}
#' }
"circle_example"
11 changes: 0 additions & 11 deletions data-raw/DATASET.R

This file was deleted.

15 changes: 15 additions & 0 deletions data-raw/circle_example.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set.seed(1234)
library(dplyr)

circle_example <- data.frame(
x = runif(400, 1, 15),
y = runif(400, 1, 15)
) %>%
mutate(
class = factor(x = sqrt((x - 8)^2 + (y - 8)^2) < 3,
levels = c(TRUE, FALSE),
labels = c("Circle", "Rest")),
id = as.character(row_number())
)

usethis::use_data(circle_example, overwrite = TRUE)
Binary file modified data/circle_example.rda
Binary file not shown.
3 changes: 2 additions & 1 deletion man/circle_example.Rd

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

0 comments on commit 8d41d1f

Please sign in to comment.