diff --git a/DESCRIPTION b/DESCRIPTION index 15d0312..451c0e3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: vikingR Type: Package Title: Creates a Viking Era ggplot2 palette -Version: 0.1.0 +Version: 0.0.0.9000 Authors@R: c( person("Matt", "Grainger", , "matthew.grainger@nina.no", role = c("aut", "cre")), person("Gavin","Stewart", role = c("aut")) @@ -11,7 +11,7 @@ License: GPL (>= 3) Encoding: UTF-8 LazyData: true Imports: ggplot2 -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.3 Suggests: rmarkdown, knitr diff --git a/NAMESPACE b/NAMESPACE index d75f824..d8d9855 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1 +1,4 @@ -exportPattern("^[[:alpha:]]+") +# Generated by roxygen2: do not edit by hand + +export(scale_colour_viking) +export(scale_fill_viking) diff --git a/R/functions.R b/R/functions.R index 3bc46cd..ae91537 100644 --- a/R/functions.R +++ b/R/functions.R @@ -66,9 +66,9 @@ scale_colour_viking <- function(palette = "Alle", discrete = TRUE, reverse = FAL pal <- viking_pal(palette = palette, reverse = reverse) if (discrete) { - discrete_scale("colour", paste0("viking_", palette), palette = pal, ...) + ggplot2::discrete_scale("colour", paste0("viking_", palette), palette = pal, ...) } else { - scale_colour_gradientn(colours = pal(256), ...) + ggplot2::scale_colour_gradientn(colours = pal(256), ...) } } @@ -84,8 +84,8 @@ scale_fill_viking <- function(palette = "Alle", discrete = TRUE, reverse = FALSE pal <- viking_pal(palette = palette, reverse = reverse) if (discrete) { - discrete_scale("fill", paste0("viking_", palette), palette = pal, ...) + ggplot2::discrete_scale("fill", paste0("viking_", palette), palette = pal, ...) } else { - scale_fill_gradientn(colours = pal(256), ...) + ggplot2::scale_fill_gradientn(colours = pal(256), ...) } } diff --git a/README.Rmd b/README.Rmd index 43498c7..5ae4172 100644 --- a/README.Rmd +++ b/README.Rmd @@ -18,15 +18,15 @@ knitr::opts_chunk$set( -vikingR creates a Viking era ggplot palette. Inspired by this [publication](https://tinyurl.com/bdfjhv25). +vikingR creates a Viking era ggplot palette. Inspired by this [publication](https://tinyurl.com/bdfjhv25). The National Museum of Denmark working with Chemists were able to recreate some of the colours that were common in the Viking era. Of course we can not know for sure if this were the only colours available at the time. ## Installation You can install the development version of vikingR from [GitHub](https://github.com/) with: ``` r -# install.packages("devtools") -devtools::install_github("DrMattG/vikingR") +# install.packages("remotes") +remotes::install_github("DrMattG/vikingR") ``` ## Example @@ -37,7 +37,7 @@ This is the basic usage: library(vikingR) library(tidyverse, quietly = TRUE) data("topNorName1880to2020") -topNorName1880to2020%>% +topNorName1880to2020 |> ggplot(aes(reorder(name,n),n, fill=name)) + geom_histogram(stat="identity") + scale_fill_viking(palette = "Alle", guide = "none")+ diff --git a/README.md b/README.md index 09a9271..88e040e 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,13 @@ # vikingR - vikingR creates a Viking era ggplot palette. Inspired by this -[publication](https://tinyurl.com/bdfjhv25). +[publication](https://tinyurl.com/bdfjhv25). The National Museum of +Denmark working with Chemists were able to recreate some of the colours +that were common in the Viking era. Of course we can not know for sure +if this were the only colours available at the time. ## Installation @@ -16,8 +18,8 @@ You can install the development version of vikingR from [GitHub](https://github.com/) with: ``` r -# install.packages("devtools") -devtools::install_github("DrMattG/vikingR") +# install.packages("remotes") +remotes::install_github("DrMattG/vikingR") ``` ## Example @@ -28,7 +30,7 @@ This is the basic usage: library(vikingR) library(tidyverse, quietly = TRUE) data("topNorName1880to2020") -topNorName1880to2020%>% +topNorName1880to2020 |> ggplot(aes(reorder(name,n),n, fill=name)) + geom_histogram(stat="identity") + scale_fill_viking(palette = "Alle", guide = "none")+ diff --git a/docs/404.html b/docs/404.html index 1442b46..cc905fb 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,66 +1,27 @@ - - - - + + + + - Page not found (404) • vikingR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - -
-
- + +
+ + + - - -
+
+
-
+ + - - diff --git a/docs/LICENSE.html b/docs/LICENSE.html index a18b636..8da21e0 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -1,66 +1,12 @@ - - - - - - - -GNU General Public License • vikingR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -GNU General Public License • vikingR - - - - + + -
-
- -
- -
+