Git Product home page Git Product logo

surveyreport's Introduction

surveyreport: Automatic Reports in Office Format Based on Tidy Specifications

Lifecycle: experimental R-CMD-check Codecov test coverage

Produces highly customizable figures, text, analyses and reports for a batch of possible dpendent-independent relations of possible interest.

Installation

The development version from GitHub with:

install.packages("devtools")
devtools::install_github("sda030/surveyreport")

Use

Please see the documentation at []

Code of Conduct

Please note that the surveyreport project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

surveyreport's People

Watchers

Stephan Daus avatar

surveyreport's Issues

map_units() function

function(data_core, data_points, data_regions)

arguments: colour scales, columns to identify what to colour, size,

Table direct to APA-format (wrapper around flextable, etc)

  • Extract main_question as table caption/title. Reuse the get_main_question() helper function
  • APA-format lines,
  • word_style, or font_size/font_family,
  • Better table headings
  • Note. N=. Tricky, because N is not stored in a percentage table?
  • Automatically remove cat 2 if only two categories present
  • Caption font_family
  • Footer font_family

Better error if faulty col input

library(dplyr)
library(surveyreport)
ex_survey1 %>%
report_chart_likert(cols = b_1|b_3, by=x1_sex)
#> Error in `dplyr::mutate()` at surveyreport/R/chart_likert.R:58:4:
#> ! Problem while computing `value = as.integer(.data$value)`.
#> Caused by error in `.data$value`:
#> ! Column `value` not found in `.data`.

#> Backtrace:
#>      ▆
#>   1. ├─ex_survey1 %>% report_chart_likert(cols = b_1 | b_3, by = x1_sex)
#>   2. ├─surveyreport::report_chart_likert(., cols = b_1 | b_3, by = x1_sex)
#>   3. │ └─surveyreport:::prepare_mschart_data(...) at surveyreport/R/chart_likert.R:363:4
#>   4. │   ├─dplyr::mutate(data, value = as.integer(.data$value)) at surveyreport/R/chart_likert.R:58:4
#>   5. │   └─dplyr:::mutate.data.frame(data, value = as.integer(.data$value))
#>   6. │     └─dplyr:::mutate_cols(.data, dplyr_quosures(...), caller_env = caller_env())
#>   7. │       ├─base::withCallingHandlers(...)
#>   8. │       └─mask$eval_all_mutate(quo)
#>   9. ├─value
#>  10. ├─rlang:::`$.rlang_data_pronoun`(.data, value)
#>  11. │ └─rlang:::data_pronoun_get(...)
#>  12. └─rlang:::abort_data_pronoun(x, call = y)
#>  13.   └─rlang::abort(msg, "rlang_error_data_pronoun_not_found", call = call)

Created on 2022-10-31 with reprex v2.0.2

label_separator bug, currently not filtering all text columns the same way

For instance:

surveyreport::report_chart_likert(data = dataset4,
cols = c_tp_1:c_lmo_5,
colour_palette = c("#E8B0B7", "#DE919A", "#D5727D", "#C84957", "#BC3848", "#9D2F3C", "#7E2630"),
docx_template = .,
colour_na = "#FFFFFF",
font_family = "Calibri",
digits=0,
#hide_label_if_below = 3,
label_separator = "Spørreundersøkelse - ",
showNA = "no") %>%
officer:::print.rdocx(target = "test7.docx")

The labels for items should start after the word "Spørreundersøkelse - ", instead we are left with some items that don't have "Spørreundersøkelse - " in front, and some that does. This has been tested on other graphs and seem to be a problem for most printed graphs in the word document, although some works just fine. For instance, there was no problem with:

surveyreport::report_chart_likert(data = dataset4,
cols = c(n_tp_5, n_tp_7, n_tp_8, n_tp_6, n_tp_9, n_tp_10),
colour_palette = c("#E8B0B7", "#DE919A", "#D5727D", "#C84957", "#BC3848", "#9D2F3C", "#7E2630"),
colour_na = "#FFFFFF",
docx_template = .,
font_family = "Calibri",
digits = 0,
#hide_label_if_below = 0,
label_separator = "\(ev. dersom de fantes\)\? - ",
showNA = "no") %>%
officer:::print.rdocx(target = "test7.docx")

Tests:

  • temp folder,

  • split test_thats

  • Remove file automatically using withr

  • Add more tests for sub-functions

  • Better tests of docx-output. Test of contents in chart.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.