diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..af035b5 --- /dev/null +++ b/README.Rmd @@ -0,0 +1,124 @@ +--- +output: github_document +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "man/figures/README-", + out.width = "100%" +) +``` + +# tidytuesdayR tidytuesdayR website + + +[![CRAN status](https://www.r-pkg.org/badges/version/tidytuesdayR)](https://CRAN.R-project.org/package=tidytuesdayR) +[![R build status](https://github.com/dslc-io/tidytuesdayR/workflows/R-CMD-check/badge.svg)](https://github.com/dslc-io/tidytuesdayR/actions) +[![Coverage +status](https://codecov.io/gh/dslc-io/tidytuesdayR/branch/main/graph/badge.svg)](https://app.codecov.io/github/dslc-io/tidytuesdayR?branch=main) +[![Downloads from the RStudio CRAN mirror](http://cranlogs.r-pkg.org/badges/tidytuesdayR)](https://cran.r-project.org/package=tidytuesdayR) +[![License: +MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![R-CMD-check](https://github.com/dslc-io/tidytuesdayR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dslc-io/tidytuesdayR/actions/workflows/R-CMD-check.yaml) + + +tidytuesdayR makes it easy to participate in the weekly [\#TidyTuesday](https://tidytues.day/) project by providing functions to quickly import data posted to the [Tidy Tuesday repository](https://github.com/rfordatascience/tidytuesday). + +## Installation + +This package is (usually) available on CRAN via: + +``` r +install.packages("tidytuesdayR") +``` + +To get the latest in-development features, install the development version from GitHub: + +``` r +#install.packages("pak") +pak::pak("dslc-io/tidytuesdayR") +``` + +## Usage + +There are currently two methods to access the data from the respository. + +### Load the Data! + +The simplest way is to use the `tt_load()` function. This +function has accepts two types of inputs to determine which data to +grab. It can be a date as a string in the YYYY-MM-DD format like below. + +``` r +library(tidytuesdayR) +tt_data <- tt_load("2019-01-15") +``` + +Or the function can accept the year as the first argument, and which +week of the year as the second. + +``` r +tt_data <- tt_load(2019, week=3) +``` + +`tt_load()` naively downloads *all* the data that is available and +stores them in the resulting `tt_data` object. To access the data, use +the `$` or `[[` notation and the name of the dataset. + +``` r +tt_data$agencies +tt_data[["agencies"]] +``` + +To view the readme, either print the `tt_data` object or use the `readme()` +function. When you print the `tt_data` object, you also get the available +datasets names printed in the console. + +``` r +readme(tt_data) +print(tt_data) +``` + +``` +## Available Datasets: +## agencies +## launches +## +``` + +### TidyTemplate + +As part of the goal of making participating in #TidyTuesday easier, {tidytuesdayR} now also provides a template! +To use it, just use the `use_tidytemplate()` function! + +By default, the template will assume to be using the most recent TidyTuesday. +However, you can pass a date object or character string in YYYY-MM-DD format +defining a different date you want to use. If you don't recall the exact date, +no worries, you can use the `tt_available()` function to figure out which date +and get the date to use! + +```r +## this weeks TidyTuesday! +tidytuesdayR::use_tidytemplate() + +## TidyTuesday from Week 42 of 2019 +tidytuesdayR::use_tidytemplate(refdate = "2019-10-15") +``` + +Additionally, by default the template will create the new file in your working +directory, using the "YYYY_MM_DD" format per good practices. +However, if you are so inclined, you can rename it to whatever you wish. + +```r +tidytuesdayR::use_tidytemplate(name = "My Super Great TidyTuesday.Rmd") +``` + +## Contributing + +Please note that the ‘tidytuesdayR’ project is released with a +[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to +this project, you agree to abide by its terms. diff --git a/_pkgdown.yml b/_pkgdown.yml index 27a4f8b..dcec163 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,3 +1,4 @@ +url: https://dslc-io.github.io/tidytuesdayR/ + template: - params: - bootswatch: cosmo + bootstrap: 5 diff --git a/man/figures/logo.png b/man/figures/logo.png index 4732835..2792148 100644 Binary files a/man/figures/logo.png and b/man/figures/logo.png differ diff --git a/pkgdown/favicon/apple-touch-icon-120x120.png b/pkgdown/favicon/apple-touch-icon-120x120.png index 80e0b84..7971345 100644 Binary files a/pkgdown/favicon/apple-touch-icon-120x120.png and b/pkgdown/favicon/apple-touch-icon-120x120.png differ diff --git a/pkgdown/favicon/apple-touch-icon-152x152.png b/pkgdown/favicon/apple-touch-icon-152x152.png index f2e1271..507e29b 100644 Binary files a/pkgdown/favicon/apple-touch-icon-152x152.png and b/pkgdown/favicon/apple-touch-icon-152x152.png differ diff --git a/pkgdown/favicon/apple-touch-icon-180x180.png b/pkgdown/favicon/apple-touch-icon-180x180.png index 3e0f4d5..e638838 100644 Binary files a/pkgdown/favicon/apple-touch-icon-180x180.png and b/pkgdown/favicon/apple-touch-icon-180x180.png differ diff --git a/pkgdown/favicon/apple-touch-icon-60x60.png b/pkgdown/favicon/apple-touch-icon-60x60.png index d20320d..f8e1af5 100644 Binary files a/pkgdown/favicon/apple-touch-icon-60x60.png and b/pkgdown/favicon/apple-touch-icon-60x60.png differ diff --git a/pkgdown/favicon/apple-touch-icon-76x76.png b/pkgdown/favicon/apple-touch-icon-76x76.png index 6626570..37439d5 100644 Binary files a/pkgdown/favicon/apple-touch-icon-76x76.png and b/pkgdown/favicon/apple-touch-icon-76x76.png differ diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png index d6e0078..0e4ff94 100644 Binary files a/pkgdown/favicon/apple-touch-icon.png and b/pkgdown/favicon/apple-touch-icon.png differ diff --git a/pkgdown/favicon/favicon-16x16.png b/pkgdown/favicon/favicon-16x16.png index 7835418..14ba866 100644 Binary files a/pkgdown/favicon/favicon-16x16.png and b/pkgdown/favicon/favicon-16x16.png differ diff --git a/pkgdown/favicon/favicon-32x32.png b/pkgdown/favicon/favicon-32x32.png index fc26427..6300f72 100644 Binary files a/pkgdown/favicon/favicon-32x32.png and b/pkgdown/favicon/favicon-32x32.png differ diff --git a/readme.md b/readme.md index 7ec2b52..d8a085a 100644 --- a/readme.md +++ b/readme.md @@ -1,31 +1,38 @@ -# tidytuesdayR + + + +# tidytuesdayR tidytuesdayR website -[![CRAN status](https://www.r-pkg.org/badges/version/tidytuesdayR)](https://CRAN.R-project.org/package=tidytuesdayR) -[![R build status](https://github.com/dslc-io/tidytuesdayR/workflows/R-CMD-check/badge.svg)](https://github.com/dslc-io/tidytuesdayR/actions) + +[![CRAN +status](https://www.r-pkg.org/badges/version/tidytuesdayR)](https://CRAN.R-project.org/package=tidytuesdayR) +[![R build +status](https://github.com/dslc-io/tidytuesdayR/workflows/R-CMD-check/badge.svg)](https://github.com/dslc-io/tidytuesdayR/actions) [![Coverage status](https://codecov.io/gh/dslc-io/tidytuesdayR/branch/main/graph/badge.svg)](https://app.codecov.io/github/dslc-io/tidytuesdayR?branch=main) -[![Downloads from the RStudio CRAN mirror](http://cranlogs.r-pkg.org/badges/tidytuesdayR)](https://cran.r-project.org/package=tidytuesdayR) +[![Downloads from the RStudio CRAN +mirror](http://cranlogs.r-pkg.org/badges/tidytuesdayR)](https://cran.r-project.org/package=tidytuesdayR) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![R-CMD-check](https://github.com/dslc-io/tidytuesdayR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dslc-io/tidytuesdayR/actions/workflows/R-CMD-check.yaml) -{tidytuesdayR} has the main goal to make it easy to participate in the -weekly [\#TidyTuesday](https://github.com/rfordatascience/tidytuesday) -project. Currently this is done by assisting with the import of data -posted on the [R4DataScience](https://github.com/rfordatascience) Tidy -Tuesday repository. +tidytuesdayR makes it easy to participate in the weekly +[\#TidyTuesday](https://tidytues.day/) project by providing functions to +quickly import data posted to the [Tidy Tuesday +repository](https://github.com/rfordatascience/tidytuesday). ## Installation -This package is available on CRAN via: +This package is (usually) available on CRAN via: ``` r install.packages("tidytuesdayR") ``` -To get the latest in-development features, install the development version from GitHub: +To get the latest in-development features, install the development +version from GitHub: ``` r #install.packages("pak") @@ -38,9 +45,9 @@ There are currently two methods to access the data from the respository. ### Load the Data! -The simplest way is to use the ‘tt\_load()’ function. This -function has accepts two types of inputs to determine which data to -grab. It can be a date as a string in the YYYY-MM-DD format like below. +The simplest way is to use the `tt_load()` function. This function has +accepts two types of inputs to determine which data to grab. It can be a +date as a string in the YYYY-MM-DD format like below. ``` r library(tidytuesdayR) @@ -63,34 +70,34 @@ tt_data$agencies tt_data[["agencies"]] ``` -To view the readme, either print the `tt_data` object or use the `readme()` -function. When you print the `tt_data` object, you also get the available -datasets names printed in the console. +To view the readme, either print the `tt_data` object or use the +`readme()` function. When you print the `tt_data` object, you also get +the available datasets names printed in the console. ``` r readme(tt_data) print(tt_data) ``` -``` -## Available Datasets: -## agencies -## launches -## -``` + ## Available Datasets: + ## agencies + ## launches + ## ### TidyTemplate -As part of the goal of making participating in #TidyTuesday easier, {tidytuesdayR} now also provides a template! -To use it, just use the `use_tidytemplate()` function! +As part of the goal of making participating in \#TidyTuesday easier, +{tidytuesdayR} now also provides a template! To use it, just use the +`use_tidytemplate()` function! -By default, the template will assume to be using the most recent TidyTuesday. -However, you can pass a date object or character string in YYYY-MM-DD format -defining a different date you want to use. If you don't recall the exact date, -no worries, you can use the `tt_available()` function to figure out which date -and get the date to use! +By default, the template will assume to be using the most recent +TidyTuesday. However, you can pass a date object or character string in +YYYY-MM-DD format defining a different date you want to use. If you +don’t recall the exact date, no worries, you can use the +`tt_available()` function to figure out which date and get the date to +use! -```r +``` r ## this weeks TidyTuesday! tidytuesdayR::use_tidytemplate() @@ -98,16 +105,14 @@ tidytuesdayR::use_tidytemplate() tidytuesdayR::use_tidytemplate(refdate = "2019-10-15") ``` -Additionally, by default the template will create the new file in your working -directory, using the "YYYY_MM_DD" format per good practices. +Additionally, by default the template will create the new file in your +working directory, using the “YYYY_MM_DD” format per good practices. However, if you are so inclined, you can rename it to whatever you wish. -```r +``` r tidytuesdayR::use_tidytemplate(name = "My Super Great TidyTuesday.Rmd") ``` - - ## Contributing Please note that the ‘tidytuesdayR’ project is released with a