diff --git a/.lintr b/.lintr index 4194039..8463a82 100644 --- a/.lintr +++ b/.lintr @@ -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"))) diff --git a/DESCRIPTION b/DESCRIPTION index 8308fa4..ceaa0bf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", , "colin@jumpingrivers.com", role = c("cre", "aut")), person("Steph", "Locke", , "stephanie.g.locke@gmail.com", role = "aut"), person("Alberto", "Cairo", , "alberto.cairo@gmail.com", role = "dtc"), - person("Rhian", "Davies", , "statsrhian@gmail.com", role = c("aut")), + person("Rhian", "Davies", , "statsrhian@gmail.com", role = "aut"), person("Justin", "Matejka", , "Justin.Matejka@autodesk.com", role = "dtc"), person("George", "Fitzmaurice", , "George.Fitzmaurice@autodesk.com", role = "dtc"), person("Lucy", "D'Agostino McGowan", , "ld.mcgowan@vanderbilt.edu", role = "aut"), @@ -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 diff --git a/Datasaurus.Rproj b/Datasaurus.Rproj index 30e02be..3084ca7 100644 --- a/Datasaurus.Rproj +++ b/Datasaurus.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: 16075796-80fe-42ac-87e0-61c1c1ac3f33 RestoreWorkspace: No SaveWorkspace: No diff --git a/NEWS.md b/NEWS.md index b4c7bf5..ef4065d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# datasauRus 0.1.9 +* Spring clean: linting + # datasauRus 0.1.8 * Update maintainer diff --git a/tests/testthat/test-datasets.R b/tests/testthat/test-datasets.R index 91c1e31..3e7d0ed 100644 --- a/tests/testthat/test-datasets.R +++ b/tests/testthat/test-datasets.R @@ -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) } } diff --git a/vignettes/Datasaurus.Rmd b/vignettes/Datasaurus.Rmd index 59a1921..cd8adc3 100644 --- a/vignettes/Datasaurus.Rmd +++ b/vignettes/Datasaurus.Rmd @@ -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), @@ -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) } ```