Skip to content

Commit

Permalink
Fixed urls
Browse files Browse the repository at this point in the history
  • Loading branch information
sda030 committed Sep 3, 2024
1 parent 6238107 commit 2493285
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Description: Offers a systematic way for conditional reporting of figures and ta
Also contains tools for immediate saving of objects and returning a hashed link to the object,
useful for creating download links to high resolution images upon rendering in 'Quarto'.
Suitable for highly customized reports, primarily intended for survey
research. Complements <https://CRAN.R-project.org/package=saros.base>.
research.
Note: Free to use for non-Norwegian institutions, otherwise see LICENSE.
License: MIT + file LICENSE
URL: https://nifu-no.github.io/saros/, https://github.com/NIFU-NO/saros
Expand Down
28 changes: 14 additions & 14 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ knitr::opts_chunk$set(

## Why saros?
- *Simplicity*: Setting up a reporting system, in particular a semi-automated one in Quarto, can be daunting - in particular if some of the chapter authors/collaborators have little familiarity with R/Python or Quarto/RMarkdown.
- [Created figures are minimal](https://nifu-no.github.io/saros/makeme.html), meaning that you are given full power to adjust them post-hoc using usual [ggplot2::theme()](https://ggplot2.tidyverse.org/reference/theme.html) tools, including [ggplot2::theme_set()](https://ggplot2.tidyverse.org/reference/theme_get.html).
- [Created figures are minimal](https://nifu-no.github.io/saros/reference/makeme.html), meaning that you are given full power to adjust them post-hoc using usual [ggplot2::theme()](https://ggplot2.tidyverse.org/reference/theme.html) tools, including [ggplot2::theme_set()](https://ggplot2.tidyverse.org/reference/theme_get.html).
- *Flexibility*:
- Several sets of chunk templates are built in, depending on the type of report you want. These templates are provided as data frames, so you can easily adjust these or create your own.
- A multitude of settings with optional glue-templating of prefixes, infixes and suffixes allows translations and adaptations.
Expand All @@ -64,30 +64,30 @@ knitr::opts_chunk$set(
## Workflow

### Preliminaries:
1. Optionally set up your project directory for [a completely new project](https://nifu-no.github.io/saros.base/create_email_credentials.html).
1. Optionally set up your project directory for [a completely new project](https://nifu-no.github.io/saros.base/reference/create_email_credentials.html).
1. Clean your raw data:
- Variables should be stored in the data type that they should be displayed as (factor, ordered factor, integer, character, etc). Ordered factors will in certain outputs be kept in the given order, whereas a set of unordered factors may be e.g. `sorted_by = ".upper"` (e.g values of the upper-most categories).
- Variables should have variable labels, and sets of variables should have the same variable label prefix. Prefix and suffix can be split by e.g " - ". Use e.g. [{labelled}](https://larmarange.github.io/labelled/reference/index.html#manipulating-variable-labels) for most operations. For advanced cleaning, see [saros.utils](https://nifu-no.github.io/saros.utils/reference/index.html)

### {saros}-tools
- [`makeme()`](https://nifu-no.github.io/saros/makeme.html) makes most types of output for your report you would need for surveys. The function can be extended with S3-methods tailored for your needs.
- [`makeme()`](https://nifu-no.github.io/saros/reference/makeme.html) makes most types of output for your report you would need for surveys. The function can be extended with S3-methods tailored for your needs.
- The core idea behind this function is the reusability of global options, which makes it possible to globally adjust all outputs with a small switch.
- [`make_link()`](https://nifu-no.github.io/saros/make_link.html) will upon rendering save a plot, dataset or any other object to disk and return a "download plot"-link with a unique (hashed) filename.
- [`n_range()`](https://nifu-no.github.io/saros/n_range.html) returns the sample size range given a dataset, dependent variables and independent variables.
- An alternative [`n_range2()`](https://nifu-no.github.io/saros/n_range2.html) allows directly using a makeme() output.
- [`fig_height_h_barchart()`](https://nifu-no.github.io/saros/fig_height_h_barchart.html) estimates the best figure height for a horizontal barchart, based on a data frame, dep and indep variables, and other arguments.
- An alternative [`fig_height_h_barchart2()`](https://nifu-no.github.io/saros/fig_height_h_barchart2.html) takes a [`makeme(type="cat_plot")`](https://nifu-no.github.io/saros/makeme.html).
- [`make_link()`](https://nifu-no.github.io/saros/reference/make_link.html) will upon rendering save a plot, dataset or any other object to disk and return a "download plot"-link with a unique (hashed) filename.
- [`n_range()`](https://nifu-no.github.io/saros/reference/n_range.html) returns the sample size range given a dataset, dependent variables and independent variables.
- An alternative [`n_range2()`](https://nifu-no.github.io/saros/reference/n_range2.html) allows directly using a makeme() output.
- [`fig_height_h_barchart()`](https://nifu-no.github.io/saros/reference/fig_height_h_barchart.html) estimates the best figure height for a horizontal barchart, based on a data frame, dep and indep variables, and other arguments.
- An alternative [`fig_height_h_barchart2()`](https://nifu-no.github.io/saros/reference/fig_height_h_barchart2.html) takes a [`makeme(type="cat_plot")`](https://nifu-no.github.io/saros/reference/makeme.html).

### {saros.base}-tools
1. Optionally specify chunk templates for what you want for each set of related variables. Or use among the built-in sets of templates.
1. Optionally, create a chapter_overview (a compact description of which dependent (and independent) variables goes in which chapter-file). A data.frame where a row is a chapter. Must contain at least the columns 'chapter' and 'dep'. 'dep' uses tidyselect-syntax in each cell. If not using any, all variables are processed and placed in the same qmd-file. [More details](https://nifu-no.github.io/saros.base/refine_chapter_overview.html)
1. [Combine the raw data, chunk templates and chapter_overview to make a chapter structure](https://nifu-no.github.io/saros.base/refine_chapter_overview.html). This will create a data frame containing your report structure, which can be further tailored. Arguments to refine_chapter_overview() allows e.g ignoring:
1. Optionally, create a chapter_overview (a compact description of which dependent (and independent) variables goes in which chapter-file). A data.frame where a row is a chapter. Must contain at least the columns 'chapter' and 'dep'. 'dep' uses tidyselect-syntax in each cell. If not using any, all variables are processed and placed in the same qmd-file. [More details](https://nifu-no.github.io/saros.base/reference/refine_chapter_overview.html)
1. [Combine the raw data, chunk templates and chapter_overview to make a chapter structure](https://nifu-no.github.io/saros.base/reference/refine_chapter_overview.html). This will create a data frame containing your report structure, which can be further tailored. Arguments to refine_chapter_overview() allows e.g ignoring:
* non-significant bivariate relationships between dependent and independent variables,
* low observation counts (sample size) for categories, variables or dependent-independent cell combinations, and/or
* variables with all NA for a given "crowd" (a target group, all others combined, or all)
1. [Draft the report](https://nifu-no.github.io/saros.base/draft_report.html), using the output from refine_chapter_overview() and your raw data. Optionally provide a range of YAML-defaults and QMD-prefixes/suffixes to your chapter-files, index-files or full report-files, as well as creating chapter-datasets for compartmentalized authoring.
1. After rendering your Quarto Project (using regular Quarto/RStudio tools), optionally [batch configure access restrictions](https://nifu-no.github.io/saros.base/setup_access_restrictions.html) and [send out glue-tailored emails](https://nifu-no.github.io/saros.base/create_email_credentials.html) to institutions that have participated in your survey, now receiving password-protected access to their own report.
1. Having done this once for a report, you might want to create a project template for your organization. Folder structures can be [mapped to a YAML file](https://nifu-no.github.io/saros.base/generate_yaml_from_directory.html) so that it can later be easily [created at once with your preferred directory numbering scheme](https://nifu-no.github.io/saros.base/download_zip_to_folder.html). If located on e.g. Github this can be [downloaded, unzipped and placed in a new project folder](https://nifu-no.github.io/saros.base/download_zip_to_folder.html).
1. [Draft the report](https://nifu-no.github.io/saros.base/reference/draft_report.html), using the output from refine_chapter_overview() and your raw data. Optionally provide a range of YAML-defaults and QMD-prefixes/suffixes to your chapter-files, index-files or full report-files, as well as creating chapter-datasets for compartmentalized authoring.
1. After rendering your Quarto Project (using regular Quarto/RStudio tools), optionally [batch configure access restrictions](https://nifu-no.github.io/saros.base/reference/setup_access_restrictions.html) and [send out glue-tailored emails](https://nifu-no.github.io/saros.base/reference/create_email_credentials.html) to institutions that have participated in your survey, now receiving password-protected access to their own report.
1. Having done this once for a report, you might want to create a project template for your organization. Folder structures can be [mapped to a YAML file](https://nifu-no.github.io/saros.base/reference/generate_yaml_from_directory.html) so that it can later be easily [created at once with your preferred directory numbering scheme](https://nifu-no.github.io/saros.base/reference/download_zip_to_folder.html). If located on e.g. Github this can be [downloaded, unzipped and placed in a new project folder](https://nifu-no.github.io/saros.base/reference/download_zip_to_folder.html).


## Installation
Expand Down Expand Up @@ -156,7 +156,7 @@ refine_chapter_overview(data = ex_survey,
Outside of Norway, this package can be used in accordance with the MIT license. However, persons affiliated with Norwegian non-profit or profit/commercial organizations must have the explicit written permission from the author for use. Simply put, if your department/organization competes with NIFU on commissioned or open research calls within Norway, you are probably not going to get permission unfortunately.

## Acknowledgements
- The internal code for reordering unordered factors in [saros:::make_contents.cat_plot_html()](https://nifu-no.github.io/saros/make_contents.cat_plot_html.html) has been copied (without permission) from Julia Silge's and David Robinson's excellent [{tidytext}](https://juliasilge.github.io/tidytext/)-package.
- The internal code for reordering unordered factors in `saros:::make_contents.cat_plot_html()` has been copied (without permission) from Julia Silge's and David Robinson's excellent [{tidytext}](https://juliasilge.github.io/tidytext/)-package.
- The code for loading all saros-packages and resolving conflicts has been copied (without permission) from the tidyverse-package and adapted.

## Code of Conduct
Expand Down
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ possible interest.
of the chapter authors/collaborators have little familiarity with
R/Python or Quarto/RMarkdown.
- [Created figures are
minimal](https://nifu-no.github.io/saros/makeme.html), meaning that
you are given full power to adjust them post-hoc using usual
minimal](https://nifu-no.github.io/saros/reference/makeme.html),
meaning that you are given full power to adjust them post-hoc using
usual
[ggplot2::theme()](https://ggplot2.tidyverse.org/reference/theme.html)
tools, including
[ggplot2::theme_set()](https://ggplot2.tidyverse.org/reference/theme_get.html).
Expand Down Expand Up @@ -93,7 +94,7 @@ possible interest.
### Preliminaries:

1. Optionally set up your project directory for [a completely new
project](https://nifu-no.github.io/saros.base/create_email_credentials.html).
project](https://nifu-no.github.io/saros.base/reference/create_email_credentials.html).
2. Clean your raw data: - Variables should be stored in the data type
that they should be displayed as (factor, ordered factor, integer,
character, etc). Ordered factors will in certain outputs be kept in
Expand All @@ -108,28 +109,28 @@ possible interest.

### {saros}-tools

- [`makeme()`](https://nifu-no.github.io/saros/makeme.html) makes most
types of output for your report you would need for surveys. The
function can be extended with S3-methods tailored for your needs.
- [`makeme()`](https://nifu-no.github.io/saros/reference/makeme.html)
makes most types of output for your report you would need for surveys.
The function can be extended with S3-methods tailored for your needs.
- The core idea behind this function is the reusability of global
options, which makes it possible to globally adjust all outputs with
a small switch.
- [`make_link()`](https://nifu-no.github.io/saros/make_link.html) will
upon rendering save a plot, dataset or any other object to disk and
return a “download plot”-link with a unique (hashed) filename.
- [`n_range()`](https://nifu-no.github.io/saros/n_range.html) returns
the sample size range given a dataset, dependent variables and
- [`make_link()`](https://nifu-no.github.io/saros/reference/make_link.html)
will upon rendering save a plot, dataset or any other object to disk
and return a “download plot”-link with a unique (hashed) filename.
- [`n_range()`](https://nifu-no.github.io/saros/reference/n_range.html)
returns the sample size range given a dataset, dependent variables and
independent variables.
- An alternative
[`n_range2()`](https://nifu-no.github.io/saros/n_range2.html) allows
directly using a makeme() output.
- [`fig_height_h_barchart()`](https://nifu-no.github.io/saros/fig_height_h_barchart.html)
[`n_range2()`](https://nifu-no.github.io/saros/reference/n_range2.html)
allows directly using a makeme() output.
- [`fig_height_h_barchart()`](https://nifu-no.github.io/saros/reference/fig_height_h_barchart.html)
estimates the best figure height for a horizontal barchart, based on a
data frame, dep and indep variables, and other arguments.
- An alternative
[`fig_height_h_barchart2()`](https://nifu-no.github.io/saros/fig_height_h_barchart2.html)
[`fig_height_h_barchart2()`](https://nifu-no.github.io/saros/reference/fig_height_h_barchart2.html)
takes a
[`makeme(type="cat_plot")`](https://nifu-no.github.io/saros/makeme.html).
[`makeme(type="cat_plot")`](https://nifu-no.github.io/saros/reference/makeme.html).

### {saros.base}-tools

Expand All @@ -141,10 +142,10 @@ possible interest.
at least the columns ‘chapter’ and ‘dep’. ‘dep’ uses
tidyselect-syntax in each cell. If not using any, all variables are
processed and placed in the same qmd-file. [More
details](https://nifu-no.github.io/saros.base/refine_chapter_overview.html)
details](https://nifu-no.github.io/saros.base/reference/refine_chapter_overview.html)
3. [Combine the raw data, chunk templates and chapter_overview to make
a chapter
structure](https://nifu-no.github.io/saros.base/refine_chapter_overview.html).
structure](https://nifu-no.github.io/saros.base/reference/refine_chapter_overview.html).
This will create a data frame containing your report structure,
which can be further tailored. Arguments to
refine_chapter_overview() allows e.g ignoring:
Expand All @@ -155,29 +156,29 @@ possible interest.
- variables with all NA for a given “crowd” (a target group, all
others combined, or all)
4. [Draft the
report](https://nifu-no.github.io/saros.base/draft_report.html),
report](https://nifu-no.github.io/saros.base/reference/draft_report.html),
using the output from refine_chapter_overview() and your raw data.
Optionally provide a range of YAML-defaults and
QMD-prefixes/suffixes to your chapter-files, index-files or full
report-files, as well as creating chapter-datasets for
compartmentalized authoring.
5. After rendering your Quarto Project (using regular Quarto/RStudio
tools), optionally [batch configure access
restrictions](https://nifu-no.github.io/saros.base/setup_access_restrictions.html)
restrictions](https://nifu-no.github.io/saros.base/reference/setup_access_restrictions.html)
and [send out glue-tailored
emails](https://nifu-no.github.io/saros.base/create_email_credentials.html)
emails](https://nifu-no.github.io/saros.base/reference/create_email_credentials.html)
to institutions that have participated in your survey, now receiving
password-protected access to their own report.
6. Having done this once for a report, you might want to create a
project template for your organization. Folder structures can be
[mapped to a YAML
file](https://nifu-no.github.io/saros.base/generate_yaml_from_directory.html)
file](https://nifu-no.github.io/saros.base/reference/generate_yaml_from_directory.html)
so that it can later be easily [created at once with your preferred
directory numbering
scheme](https://nifu-no.github.io/saros.base/download_zip_to_folder.html).
scheme](https://nifu-no.github.io/saros.base/reference/download_zip_to_folder.html).
If located on e.g. Github this can be [downloaded, unzipped and
placed in a new project
folder](https://nifu-no.github.io/saros.base/download_zip_to_folder.html).
folder](https://nifu-no.github.io/saros.base/reference/download_zip_to_folder.html).

## Installation

Expand Down Expand Up @@ -256,9 +257,8 @@ permission unfortunately.
## Acknowledgements

- The internal code for reordering unordered factors in
[saros:::make_contents.cat_plot_html()](https://nifu-no.github.io/saros/make_contents.cat_plot_html.html)
has been copied (without permission) from Julia Silge’s and David
Robinson’s excellent
`saros:::make_contents.cat_plot_html()` has been copied (without
permission) from Julia Silge’s and David Robinson’s excellent
[{tidytext}](https://juliasilge.github.io/tidytext/)-package.
- The code for loading all saros-packages and resolving conflicts has
been copied (without permission) from the tidyverse-package and
Expand Down
Loading

0 comments on commit 2493285

Please sign in to comment.