Skip to content

Commit

Permalink
Spring clean for CRAN update (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
csgillespie authored Jan 23, 2025
1 parent 498d247 commit 0496ac1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 25 deletions.
19 changes: 9 additions & 10 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
linters: with_defaults(
line_length_linter(100),
assignment_linter = NULL,
undesirable_operator_linter = undesirable_operator_linter(
with_defaults(
default_undesirable_operators,
"<-" = "Use =, not <-, for assignment."
)
)
)
linters: linters_with_defaults(
assignment_linter = NULL,
indentation_linter = NULL,
commented_code_linter = NULL,
object_length_linter = NULL,
line_length_linter(100),
cyclocomp_linter(complexity_limit = 15),
undesirable_operator_linter = undesirable_operator_linter(
op = list("<-" = "Please use '=' for assignment")))
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: datasauRus
Title: Datasets from the Datasaurus Dozen
Version: 0.1.8
Version: 0.1.9
Authors@R: c(
person("Colin", "Gillespie", , "[email protected]", role = c("cre", "aut")),
person("Steph", "Locke", , "[email protected]", role = "aut"),
person("Alberto", "Cairo", , "[email protected]", role = "dtc"),
person("Rhian", "Davies", , "[email protected]", role = c("aut")),
person("Rhian", "Davies", , "[email protected]", role = "aut"),
person("Justin", "Matejka", , "[email protected]", role = "dtc"),
person("George", "Fitzmaurice", , "[email protected]", role = "dtc"),
person("Lucy", "D'Agostino McGowan", , "[email protected]", role = "aut"),
Expand Down Expand Up @@ -42,7 +42,7 @@ Suggests:
VignetteBuilder:
knitr
Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Language: en-US
RoxygenNote: 7.3.2
1 change: 1 addition & 0 deletions Datasaurus.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 16075796-80fe-42ac-87e0-61c1c1ac3f33

RestoreWorkspace: No
SaveWorkspace: No
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# datasauRus 0.1.9
* Spring clean: linting

# datasauRus 0.1.8

* Update maintainer
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-datasets.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
context("datasets")

datashapetests = function(df, ncols, nrows, uniquecol = NULL, nuniques = NULL) {
expect_equal(ncol(df), ncols)
expect_equal(nrow(df), nrows)
testthat::expect_equal(ncol(df), ncols)
testthat::expect_equal(nrow(df), nrows)
if (!is.null(uniquecol)) {
expect_equal(nrow(unique(df[uniquecol])), nuniques)
testthat::expect_equal(nrow(unique(df[uniquecol])), nuniques)
}
}

Expand Down
16 changes: 8 additions & 8 deletions vignettes/Datasaurus.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ To see that statistics are (almost) the same for each sub-dataset, you can use `

```{r}
library(datasauRus)
if(requireNamespace("dplyr")){
if (requireNamespace("dplyr")) {
suppressPackageStartupMessages(library(dplyr))
datasaurus_dozen %>%
group_by(dataset) %>%
datasaurus_dozen %>%
group_by(dataset) %>%
summarize(
mean_x = mean(x),
mean_y = mean(y),
Expand All @@ -41,12 +41,12 @@ if(requireNamespace("dplyr")){
To see that each sub-dataset looks very different, you can draw scatter plots.

```{r fig.height=12, fig.width=9}
if(requireNamespace("ggplot2")){
if (requireNamespace("ggplot2")) {
library(ggplot2)
ggplot(datasaurus_dozen, aes(x = x, y = y, colour = dataset))+
geom_point()+
theme_void()+
theme(legend.position = "none")+
ggplot(datasaurus_dozen, aes(x = x, y = y, colour = dataset)) +
geom_point() +
theme_void() +
theme(legend.position = "none") +
facet_wrap(~dataset, ncol = 3)
}
```

0 comments on commit 0496ac1

Please sign in to comment.