Skip to content

Commit

Permalink
Merge pull request #144 from NIFU-NO/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
sda030 authored Jan 10, 2025
2 parents ffbf7db + 58b7915 commit dd54a85
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 136 deletions.
121 changes: 0 additions & 121 deletions .github/workflows/quarto-setup.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
## Major changes

* Total revision of the entire architecture for maximum flexibility, stability and performance.
* Uses glue templates for creating chunks, see `refine_chapter_structure()`.
* `draft_report()`
* Breaking changes for mesos setup, now uses `setup_mesos()` as well for creating stub files referring to a smaller set of main files created by `draft_report()`.
* Countless bugfixes.

## Minor changes
* Helper function `remove_entry_from_sidebar()` for post-processing HTML-files
* Many more validations of arguments and better error messages.

# saros.base 0.2.2

Expand Down
8 changes: 1 addition & 7 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
## R CMD check results

0 errors | 0 warnings | 4 notes
0 errors | 0 warnings | 0 notes

## Note

- Fixed return values docs and removed write-by-default.
- Remaining cat() use is merely for writing to disk (main purpose of functions) or if log file has been specified (defaults to off).
- URLs are correct (will be valid upon release).
- rhub fails for MacOS-R-devel due to failure in building RApiSerialize 0.1.3. I have waited to see if it magically got fixed but to no avail. Pretty sure there is nothing I can do on my end, as all other runs succeed.
6 changes: 3 additions & 3 deletions vignettes/vig_02_project_setup.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ setwd(tempdir())
# Create a research project folder from scratch

- The following is intended for creating and maintaining a consistent and well-organized folder structure, based on some international "standards".
- If you have already set up a project structure or data collection, jump to [step 2]().
- If you have already set up a project structure or data collection, jump to @sec-tailor-project-settings.

## Whatever you chose...

Expand Down Expand Up @@ -85,10 +85,10 @@ saros.base::initialize_saros_project(
```


# Tailor project settings
# Tailor project settings{#sec-tailor-project-settings}

- Saros expands upon the inheritance idea in Quarto and allows setting and exempting settings inheritance-wise: organization level, project level, report cycle, chapter and chunk. This means that one can set defaults which can be overridden per project or per report.
- For instance, [NIFU](www.nifu.no) sets its organization-level settings that apply to all projects in one global R-file, which contains figure colour palette rules, special functions, and so forth.
- For instance, [NIFU](https:://www.nifu.no) sets its organization-level settings that apply to all projects in one global R-file, which contains figure colour palette rules, special functions, and so forth.
- This is currently limited to R-files used for generating reports and for rendering reports. The yaml metadata is currently duplicated per project, and will be in the future centralized in one location.
- File lanes in particular must be standardized across data collection cycles. Avoid that each implementation has its own folder in the project's main folder - experience shows that it is very difficult to keep consistent folder structures across years when you are rarely confronted with how things have been done in the past. Try as much as possible to have the year folder at the bottom of the hierarchy - even if this means that you have to copy a number of subfolders every year.

Expand Down
6 changes: 3 additions & 3 deletions vignettes/vig_04_prepare_data.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The principles of variable names and variable labels aim to allow Saros to autom

- Try to avoid letters that look the same in upper and lower case.

- See \[standard variable names in longitudinal projects\](vig_05_standard_variable_names.qmd)
- See [standard variable names in longitudinal projects](vig_05_standard_variable_names.qmd)

- Optimally, all batteries should share the same prefix in the variable name, which is unique from all other batteries/variables. For example, one can name the variables s_100-s_120 for one battery, g_121-g_129 for another battery, etc. and specify that `variable_name_separator = "_"`. However, another equally fine approach is to name variables in a self-explanatory

Expand Down Expand Up @@ -80,7 +80,7 @@ ex_survey |>
map(~levels(.x))
```

- All categorical variables should be of the factor type with all possible response options as its categorical levels (levels). This makes the graphs and tables as correct as possible. See example below to correct this if you receive the data as e.g. `character()` or `integer()` (something you should definitely avoid at all costs as it is time-consuming to restore the data.
- All categorical variables should be of the factor type with all possible response options as its categorical levels (levels). This makes the graphs and tables as correct as possible. See example below to correct this if you receive the data as e.g. `character()` or `integer()` (something you should definitely avoid at all costs as it is time-consuming to restore the data).

```{r}
data <-
Expand Down Expand Up @@ -118,7 +118,7 @@ data <-

Variable labels are typically the actual question formulation in a questionnaire, or a definition of how data has been collected.

- All variables to be used must have a label, this also applies to e.g. independent variables that you have created yourself. See the [`{labelled}`](https://cran.r-project.org/web/packages/labelled/index.html) package for functions to easily set labels if something is missing.
- All variables to be used must have a label, this also applies to e.g. independent variables that you have created yourself. See the [`{labelled}`](https://CRAN.R-project.org/package=labelled) package for functions to easily set labels if something is missing.

- Note that in R, variable labels are not considered to be still valid if you have changed the variable's content (with e.g. `mutate()`), and **the labels therefore unfortunately disappear**. However, you can copy them back in afterwards with `labelled::copy_labels_from(original_data)`.

Expand Down
4 changes: 2 additions & 2 deletions vignettes/vig_06_prepare_chapter_overview.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vignette: >

The chapter overview can be made when variable names have been determined.

Each report must have a table, where each line is a chapter. This is typically an Excel file that is easy to edit manually. See an example [here](chapter_overview.xlsx).
Each report must have a table, where each line is a chapter. This is typically an Excel file that is easy to edit manually, or create a data frame in R.

![](screenshot_chapter_overview.png)

Expand All @@ -29,4 +29,4 @@ May also contain:
- Or other variables you may have - can be fine if you need to use the same chapter overview to keep track of who at the client is responsible for the topic, where in the questionnaire the questions are, etc. These are ignored by saros.


`saros::draft_report()` will produce a log of which variables exist in the dataset but are not used in chapter overview, auxiliary_variables or mesos_var.
`saros::draft_report()` will produce a log of which variables exist in the dataset but are not used in chapter overview, auxiliary_variables or mesos_var.

0 comments on commit dd54a85

Please sign in to comment.