if in dropdown
35 | if (pos >= 0) {
36 | var menu_anchor = $(links[pos]);
37 | menu_anchor.parent().addClass("active");
38 | menu_anchor.closest("li.dropdown").addClass("active");
39 | }
40 | });
41 |
42 | function paths(pathname) {
43 | var pieces = pathname.split("/");
44 | pieces.shift(); // always starts with /
45 |
46 | var end = pieces[pieces.length - 1];
47 | if (end === "index.html" || end === "")
48 | pieces.pop();
49 | return(pieces);
50 | }
51 |
52 | // Returns -1 if not found
53 | function prefix_length(needle, haystack) {
54 | if (needle.length > haystack.length)
55 | return(-1);
56 |
57 | // Special case for length-0 haystack, since for loop won't run
58 | if (haystack.length === 0) {
59 | return(needle.length === 0 ? 0 : -1);
60 | }
61 |
62 | for (var i = 0; i < haystack.length; i++) {
63 | if (needle[i] != haystack[i])
64 | return(i);
65 | }
66 |
67 | return(haystack.length);
68 | }
69 |
70 | /* Clipboard --------------------------*/
71 |
72 | function changeTooltipMessage(element, msg) {
73 | var tooltipOriginalTitle=element.getAttribute('data-original-title');
74 | element.setAttribute('data-original-title', msg);
75 | $(element).tooltip('show');
76 | element.setAttribute('data-original-title', tooltipOriginalTitle);
77 | }
78 |
79 | if(ClipboardJS.isSupported()) {
80 | $(document).ready(function() {
81 | var copyButton = "";
82 |
83 | $(".examples, div.sourceCode").addClass("hasCopyButton");
84 |
85 | // Insert copy buttons:
86 | $(copyButton).prependTo(".hasCopyButton");
87 |
88 | // Initialize tooltips:
89 | $('.btn-copy-ex').tooltip({container: 'body'});
90 |
91 | // Initialize clipboard:
92 | var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', {
93 | text: function(trigger) {
94 | return trigger.parentNode.textContent;
95 | }
96 | });
97 |
98 | clipboardBtnCopies.on('success', function(e) {
99 | changeTooltipMessage(e.trigger, 'Copied!');
100 | e.clearSelection();
101 | });
102 |
103 | clipboardBtnCopies.on('error', function() {
104 | changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy');
105 | });
106 | });
107 | }
108 | })(window.jQuery || window.$)
109 |
--------------------------------------------------------------------------------
/docs/pkgdown.yml:
--------------------------------------------------------------------------------
1 | pandoc: 2.11.0.4
2 | pkgdown: 1.6.1
3 | pkgdown_sha: ~
4 | last_built: 2021-06-08T09:05Z
5 |
6 |
--------------------------------------------------------------------------------
/docs/reference/Rplot001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/Rplot001.png
--------------------------------------------------------------------------------
/docs/reference/figures/CheatSheet_overviewR.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/CheatSheet_overviewR.pdf
--------------------------------------------------------------------------------
/docs/reference/figures/ex1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/ex1.png
--------------------------------------------------------------------------------
/docs/reference/figures/ex2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/ex2.png
--------------------------------------------------------------------------------
/docs/reference/figures/ex3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/ex3.png
--------------------------------------------------------------------------------
/docs/reference/figures/extension1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/extension1.png
--------------------------------------------------------------------------------
/docs/reference/figures/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/logo.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-19-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-19-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-20-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-20-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-21-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-21-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-22-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-22-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-23-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-23-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-24-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-24-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-25-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-25-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-26-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-26-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-27-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-27-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-28-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-28-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-30-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-30-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-31-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-31-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-32-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-32-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-33-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-33-1.png
--------------------------------------------------------------------------------
/docs/reference/figures/unnamed-chunk-34-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/figures/unnamed-chunk-34-1.png
--------------------------------------------------------------------------------
/docs/reference/overview_crossplot-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/overview_crossplot-1.png
--------------------------------------------------------------------------------
/docs/reference/overview_heat-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/overview_heat-1.png
--------------------------------------------------------------------------------
/docs/reference/overview_na-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/overview_na-1.png
--------------------------------------------------------------------------------
/docs/reference/overview_plot-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/docs/reference/overview_plot-1.png
--------------------------------------------------------------------------------
/index.md:
--------------------------------------------------------------------------------
1 | # Getting started
2 |
3 |
4 |
5 | [](https://github.com/cosimameyer/overviewR/actions)
6 | [](https://app.codecov.io/gh/cosimameyer/overviewR?branch=master)
8 | [](https://www.repostatus.org/#active)
11 | [](https://github.com/cosimameyer/overviewR)
13 | [](https://github.com/cosimameyer/overviewR)
15 | [](https://cran.r-project.org/package=overviewR)
16 | [](https://www.gnu.org/licenses/gpl-3.0.en.html)
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | ## What is `overviewR`?
27 |
28 | overviewR is a small yet powerful package that helps you to **get an overview** – hence, the name – **of your data** with particular emphasis on the **extent that your distinct units of observation are covered for the entire time frame** of your data set.
29 |
30 |
31 | ## How can you install it?
32 |
33 |
34 | A stable version of `overviewR` can be directly accessed on CRAN:
35 |
36 | ``` r
37 | install.packages("overviewR", force = TRUE)
38 | ```
39 |
40 | To install the latest development version of `overviewR` directly from
41 | [GitHub](https://github.com/cosimameyer/overviewR) use:
42 |
43 | ``` r
44 | library(devtools) # Tools to Make Developing R Packages Easier # Tools to Make Developing R Packages Easier
45 | devtools::install_github("cosimameyer/overviewR")
46 | ```
47 |
48 |
49 | ## Why did we build it?
50 |
51 | If you have a (large) data set that has many different observations over a long period, it becomes increasingly **difficult to identify for each unique observation its exact coverage in the data**. In particular, if some observations are not included for the entire time span of the data – either because they entered later, dropped out earlier or have gaps in between – it can become difficult to spot potential problems in your data’s time and scope.
52 |
53 | overviewR allows you to **quickly get a glimpse of your data and the distribution of your observations over time**. With its ability to **produce both data.frame objects and LaTeX/.tex outputs**, it can be used by **practitioners and academics alike**.
54 |
55 | ## How can it be used?
56 |
57 | overviewR can be used by everyone who works with data that have **time-and-scope characteristics**. That is, all data that contains different units of observation over a specific period will benefit from overviewR. To get a quick overview of **which units** – think of countries, companies, test persons, etc. – **are present or missing during a given time span** – think of years, months, days, minutes, etc. – overviewR provides an **easy and intuitive insight** into the set-up of your data.
58 |
59 | Consider a data set that covers countries over the past 50 years. **Not all countries existed throughout the entire period** – some dissolved, others were newly founded and yet for others, data might not be available for the entire period. Before starting any analysis, it is helpful to get an overview not only of which countries are included and what the entire time span is but also to **see which countries are present at which points in time**. In other words, are there missing data for certain countries at different points in time?
60 |
61 | To get a quick and intuitive overview of your data, overviewR provides currently the following basic functions:
62 |
63 | - **overview_tab** generates a basic table that lists all unique units of observation (e.g., countries) and aggregates the time frame at which each unit is present in the data set. This means it also takes into account gaps in the data set, e.g., when there is – for whatever reason – no data available for a country for a few years within the time frame
64 | - **overview_crosstab** generates a similar table but allows you to separate the overview table using two conditions. For instance, you want to know not only at what time points countries are present in your data but also when these countries can be considered to have high or low GDP and can be categorized as having a small or large population size. For this, overview_crosstab is used.
65 | overview_print takes a table – either generated by overview_tab or overview_crosstab and turns it into a LaTeX output. It even allows you to save the LaTeX output in a ready-to-use .tex file.
66 | - **overview_plot** visualizes the time and scope conditions of your data in a ggplot plot. For each scope object in your data (e.g., countries) on the y-axis, it plots the time coverage (x-axis) as a horizontal line for all time points in your data. This helps to spot gaps in your data for specific scope objects or simply creates a graphical display of your time and scope conditions and can be a good companion for presentation slides or appendices.
67 | overview_crossplot is an alternative to visualize a cross table (a way to present results from overview_crosstab)
68 | - **overview_heat** visualizes the coverage of each time and scope combination of your dataset in a heat map style ggplot. Each cell in the heat map is colored based on the coverage of a scope object at a given time point. Additionally, it displays either the total number of cases covered or a relative percentage as plain text. This helps to spot missing information even more nuanced. For instance, in a monthly data set with countries as the scope object, it illustrates the percentage of covered months in the data for each country-year combination.
69 | - **overview_na** graphically illustrates the total number of NAs across all variables in your data set as a horizontal bar plot. Similar to the other plot objects, overview_na returns a ggplot object and can be modified and adjusted accordingly.
70 | - **overview_overlap** plots the overlap between two data sets.
71 |
72 | There is also a [CheatSheet](https://github.com/rstudio/cheatsheets/blob/main/overviewR.pdf) available here that showcases the functions of overviewR.
73 |
74 |
75 | ## Get involved!
76 |
77 | Have you used overviewR in your project? **Let us know!** You can either e-mail us or use our pull-request template and populate/fill the following with your information:
78 |
79 | ```
80 | **PROJECT TITLE**:
81 | --SHORT DESCRIPTION HOW YOU USED OVERVIEWR--
82 | [*LINK TO YOUR WEBSITE*](https://LINK-TO-YOUR-WEBSITE)
83 | ```
84 |
85 | We will feature your project below!
86 |
87 | ## Projects using overviewR
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/man/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/.DS_Store
--------------------------------------------------------------------------------
/man/calculate_share_non_row_wise.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/calculate_share_non_row_wise.R
3 | \name{calculate_share_non_row_wise}
4 | \alias{calculate_share_non_row_wise}
5 | \title{calculate_share_non_row_wise}
6 | \usage{
7 | calculate_share_non_row_wise(dat = NULL)
8 | }
9 | \arguments{
10 | \item{dat}{Data frame}
11 | }
12 | \value{
13 | The function returns a data set that has the information
14 | on the column-wise NA share
15 | }
16 | \description{
17 | Function used in `overview_na` to calculate the column-wise share of NA
18 | }
19 |
--------------------------------------------------------------------------------
/man/calculate_share_row_wise.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/calculate_share_row_wise.R
3 | \name{calculate_share_row_wise}
4 | \alias{calculate_share_row_wise}
5 | \title{calculate_share_row_wise}
6 | \usage{
7 | calculate_share_row_wise(dat = NULL)
8 | }
9 | \arguments{
10 | \item{dat}{Data frame}
11 | }
12 | \value{
13 | The function returns a data set that has the information
14 | on the row-wise NA share
15 | }
16 | \description{
17 | Function used in `overview_na` to calculate the share of NA row-wise
18 | }
19 |
--------------------------------------------------------------------------------
/man/dot-overview_heat.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/private_overview_heat.R
3 | \name{.overview_heat}
4 | \alias{.overview_heat}
5 | \title{.overview_tab}
6 | \usage{
7 | .overview_heat(
8 | dat = NULL,
9 | id = NULL,
10 | time = NULL,
11 | label = FALSE,
12 | perc = FALSE,
13 | col_low = NULL,
14 | col_high = NULL,
15 | xaxis = NULL,
16 | yaxis = NULL,
17 | theme_plot = NULL,
18 | exp_total = NULL,
19 | col_names = NULL
20 | )
21 | }
22 | \arguments{
23 | \item{dat}{The data set}
24 |
25 | \item{id}{The scope (e.g., country codes or individual IDs). The axis is
26 | ordered in ascending order by default.}
27 |
28 | \item{time}{The time (e.g., time periods given by years, months, ...)}
29 |
30 | \item{label}{If TRUE (default), the total number of observations/percentages
31 | of observations are displayed. If FALSE, it returns no labels.}
32 |
33 | \item{perc}{If FALSE (default) plot returns the total number of observations
34 | per time-scope-unit. If TRUE, it returns the number of observations per
35 | time-scope-unit in percentage}
36 |
37 | \item{col_low}{Hex color code for the lowest value (default is "#dceaf2")}
38 |
39 | \item{col_high}{Hex color code for the lowest value (default is "#2A5773")}
40 |
41 | \item{xaxis}{Label of your x axis ("Time frame" is default)}
42 |
43 | \item{yaxis}{Label of your y axis ("Sample" is default)}
44 |
45 | \item{theme_plot}{Previously generated theme}
46 |
47 | \item{exp_total}{Expected total number of observations (i.e. maximum)
48 | for time unit.}
49 |
50 | \item{col_names}{The column names (containing id and time)}
51 | }
52 | \value{
53 | A ggplot
54 | }
55 | \description{
56 | Internal function that calculates the `overview_tab` for data.table objects
57 | }
58 |
--------------------------------------------------------------------------------
/man/dot-overview_tab.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/private_overview_tab.R
3 | \name{.overview_tab}
4 | \alias{.overview_tab}
5 | \title{.overview_tab}
6 | \usage{
7 | .overview_tab(dat = NULL, id = NULL, time = NULL, col_names = NULL)
8 | }
9 | \arguments{
10 | \item{dat}{Your data set}
11 |
12 | \item{id}{Scope (e.g., country codes or individual IDs)}
13 |
14 | \item{time}{Time (e.g., time periods given by years, months, ...). There are three options to add a date variable: 1) Time can be a character vector containing **one** time variable, 2) a time variable following the YYYY-MM-DD format, or 3) or a list containing multiple time variables (`time = list(year = NULL, month = NULL, day = NULL)`).}
15 |
16 | \item{col_names}{The column names (containing id and time)}
17 | }
18 | \value{
19 | A data.table
20 | }
21 | \description{
22 | Internal function that calculates the `overview_tab` for data.table objects
23 | }
24 |
--------------------------------------------------------------------------------
/man/figures/CheatSheet_overviewR.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/CheatSheet_overviewR.pdf
--------------------------------------------------------------------------------
/man/figures/bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/bar.png
--------------------------------------------------------------------------------
/man/figures/dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/dot.png
--------------------------------------------------------------------------------
/man/figures/ex1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/ex1.png
--------------------------------------------------------------------------------
/man/figures/ex2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/ex2.png
--------------------------------------------------------------------------------
/man/figures/ex3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/ex3.png
--------------------------------------------------------------------------------
/man/figures/extension1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/extension1.png
--------------------------------------------------------------------------------
/man/figures/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/logo.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-19-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-19-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-20-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-20-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-21-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-21-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-22-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-22-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-23-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-23-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-24-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-24-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-25-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-25-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-26-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-26-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-27-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-27-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-28-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-28-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-29-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-29-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-30-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-30-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-31-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-31-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-32-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-32-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-33-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-33-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-34-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-34-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-35-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-35-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-36-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-36-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-37-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-37-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-38-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-38-1.png
--------------------------------------------------------------------------------
/man/figures/unnamed-chunk-39-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/unnamed-chunk-39-1.png
--------------------------------------------------------------------------------
/man/figures/venn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/man/figures/venn.png
--------------------------------------------------------------------------------
/man/find_int_runs.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/helper.R
3 | \name{find_int_runs}
4 | \alias{find_int_runs}
5 | \title{find_int_runs}
6 | \usage{
7 | find_int_runs(run = NULL)
8 | }
9 | \arguments{
10 | \item{run}{Variable (integer) that should be checked for consecutive values}
11 | }
12 | \value{
13 | The function returns a data set
14 | }
15 | \description{
16 | Function used in `overview_tab` to find running integers
17 | }
18 |
--------------------------------------------------------------------------------
/man/overview_add_na_output.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_add_na_output.R
3 | \name{overview_add_na_output}
4 | \alias{overview_add_na_output}
5 | \title{overview_add_na_output}
6 | \usage{
7 | overview_add_na_output(dat_result = NULL, dat = NULL)
8 | }
9 | \arguments{
10 | \item{dat_result}{Data.frame from `overview_na`}
11 |
12 | \item{dat}{Data frame}
13 | }
14 | \value{
15 | The function returns a data set that has the information
16 | on the row-wise NA share
17 | }
18 | \description{
19 | Function used in `overview_na` to generate a new data frame with
20 | na_count and percentage share of NAs for each row
21 | }
22 |
--------------------------------------------------------------------------------
/man/overview_crossplot.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_crossplot.R
3 | \name{overview_crossplot}
4 | \alias{overview_crossplot}
5 | \title{overview_crossplot}
6 | \usage{
7 | overview_crossplot(
8 | dat,
9 | id,
10 | time,
11 | cond1,
12 | cond2,
13 | threshold1,
14 | threshold2,
15 | xaxis = "Condition 1",
16 | yaxis = "Condition 2",
17 | label = FALSE,
18 | color = FALSE,
19 | dot_size = 2,
20 | fontsize = 2.5
21 | )
22 | }
23 | \arguments{
24 | \item{dat}{Your data set}
25 |
26 | \item{id}{Your scope (e.g., country codes or individual IDs). If the id
27 | variable contains NAs, they will not be included in the plot.}
28 |
29 | \item{time}{Your time (e.g., time periods given by years, months, ...)}
30 |
31 | \item{cond1}{Variable that describes the first condition}
32 |
33 | \item{cond2}{Variable that describes the second condition}
34 |
35 | \item{threshold1}{A threshold for \code{cond1}}
36 |
37 | \item{threshold2}{A threshold for \code{cond2}}
38 |
39 | \item{xaxis}{Label of the x axis ("Condition 1" is default)}
40 |
41 | \item{yaxis}{Label of the y axis ("Condition 2" is default)}
42 |
43 | \item{label}{Label of the observations. Overlapping labels are
44 | avoided by using 'ggrepel'}
45 |
46 | \item{color}{Color of the different observation groups}
47 |
48 | \item{dot_size}{Option argument that defines the dot size (default is 2)}
49 |
50 | \item{fontsize}{If label is TRUE, the fontsize arguments allows to define the text of the labels (the default is 2.5)}
51 | }
52 | \value{
53 | A ggplot figure that presents the sample information visually
54 | in a cross table
55 | }
56 | \description{
57 | This function plots a ggplot to visualize a cross table plot.
58 | }
59 | \examples{
60 | data(toydata)
61 | overview_crossplot(
62 | dat = toydata,
63 | cond1 = gdp,
64 | cond2 = population,
65 | threshold1 = 25000,
66 | threshold2 = 27000,
67 | id = ccode,
68 | time = year
69 | )
70 | }
71 |
--------------------------------------------------------------------------------
/man/overview_crosstab.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_crosstab.R
3 | \name{overview_crosstab}
4 | \alias{overview_crosstab}
5 | \title{overview_crosstab}
6 | \usage{
7 | overview_crosstab(dat, cond1, cond2, threshold1, threshold2, id, time)
8 | }
9 | \arguments{
10 | \item{dat}{A data set object}
11 |
12 | \item{cond1}{Variable that describes the first condition}
13 |
14 | \item{cond2}{Variable that describes the second condition}
15 |
16 | \item{threshold1}{A threshold for \code{cond1}}
17 |
18 | \item{threshold2}{A threshold for \code{cond2}}
19 |
20 | \item{id}{Scope (e.g., country codes or individual IDs)}
21 |
22 | \item{time}{Time (e.g., time periods given by years, months, ...)}
23 | }
24 | \value{
25 | A data frame object that contains a summary of the data set that can
26 | later be converted to a 'LaTeX' output using \code{overview_latex}
27 | }
28 | \description{
29 | Sorts a data set conditionally in a cross table.
30 | This can be helpful to get a sense of the time and scope
31 | conditions of a data set. Note, if used with a data set that has multiple
32 | observations on the id-time unit, the function automatically aggregates
33 | this information using the mean.
34 | }
35 | \examples{
36 | data(toydata)
37 | overview_crosstab(
38 | dat = toydata,
39 | cond1 = gdp,
40 | cond2 = population,
41 | threshold1 = 25000,
42 | threshold2 = 27000,
43 | id = ccode,
44 | time = year
45 | )
46 | }
47 |
--------------------------------------------------------------------------------
/man/overview_heat.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_heat.R
3 | \name{overview_heat}
4 | \alias{overview_heat}
5 | \title{overview_heat}
6 | \usage{
7 | overview_heat(
8 | dat,
9 | id,
10 | time,
11 | perc = FALSE,
12 | exp_total = NULL,
13 | xaxis = "Time frame",
14 | yaxis = "Sample",
15 | col_low = "#dceaf2",
16 | col_high = "#2A5773",
17 | label = TRUE
18 | )
19 | }
20 | \arguments{
21 | \item{dat}{The data set}
22 |
23 | \item{id}{The scope (e.g., country codes or individual IDs). The axis is
24 | ordered in ascending order by default.}
25 |
26 | \item{time}{The time (e.g., time periods given by years, months, ...)}
27 |
28 | \item{perc}{If FALSE (default) plot returns the total number of observations
29 | per time-scope-unit. If TRUE, it returns the number of observations per
30 | time-scope-unit in percentage}
31 |
32 | \item{exp_total}{Expected total number of observations (i.e. maximum)
33 | for time unit.}
34 |
35 | \item{xaxis}{Label of your x axis ("Time frame" is default)}
36 |
37 | \item{yaxis}{Label of your y axis ("Sample" is default)}
38 |
39 | \item{col_low}{Hex color code for the lowest value (default is "#dceaf2")}
40 |
41 | \item{col_high}{Hex color code for the lowest value (default is "#2A5773")}
42 |
43 | \item{label}{If TRUE (default), the total number of observations/percentages
44 | of observations are displayed. If FALSE, it returns no labels.}
45 | }
46 | \value{
47 | A ggplot figure that presents sample coverage visually
48 | }
49 | \description{
50 | This function plots a heat map to visualize the
51 | coverage of the time-scope-units of the data. Options include total
52 | number of cases per time-scope-unit or relative number in percentage.
53 | }
54 | \examples{
55 | data(toydata)
56 | overview_heat(toydata, ccode, year, perc = TRUE, exp_total = 12)
57 | }
58 |
--------------------------------------------------------------------------------
/man/overview_latex.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_latex.R
3 | \name{overview_latex}
4 | \alias{overview_latex}
5 | \title{overview_latex}
6 | \usage{
7 | overview_latex(
8 | obj,
9 | title = "Time and scope of the sample",
10 | id = "Sample",
11 | time = "Time frame",
12 | crosstab = FALSE,
13 | cond1 = "Condition 1",
14 | cond2 = "Condition 2",
15 | save_out = FALSE,
16 | file_path,
17 | label = "tab:tab1",
18 | fontsize,
19 | file,
20 | path
21 | )
22 | }
23 | \arguments{
24 | \item{obj}{Overview object produced by overview_tab or overview_crosstab}
25 |
26 | \item{title}{Caption of the table (default is "Time and scope of the sample")}
27 |
28 | \item{id}{The name of the left column (default is "Sample"), will be ignored
29 | if crosstab is TRUE}
30 |
31 | \item{time}{The name of the right column (default is ("Time frame")), will
32 | be ignored if \code{crosstab} is TRUE}
33 |
34 | \item{crosstab}{Logical argument, if TRUE produces a \code{crosstab} output,
35 | default is FALSE}
36 |
37 | \item{cond1}{Description for the first condition (character), will be
38 | ignored if \code{crosstab} is FALSE. This should correspond to the input
39 | for \code{cond1} in \code{overview_crosstab}}
40 |
41 | \item{cond2}{Description for the second condition (character), will be
42 | ignored if \code{crosstab} is FALSE. This should correspond to the input
43 | for \code{cond2} in \code{overview_crosstab}}
44 |
45 | \item{save_out}{Optional argument, exports the output table as a .tex
46 | file, default is FALSE}
47 |
48 | \item{file_path}{Specifies the path and file name (.tex) where you store your output}
49 |
50 | \item{label}{Specifies the label (default is "tab:tab1")}
51 |
52 | \item{fontsize}{Specifies the font size (all 'LaTeX' font sizes such as
53 | "scriptsize" or "small" work)}
54 |
55 | \item{file}{This argument is deprecated. Please use "file_path" instead and add the full path.}
56 |
57 | \item{path}{This argument is deprecated. Please use "file_path" instead and add the full path.}
58 | }
59 | \value{
60 | A 'LaTeX' output that can either be copy-pasted in a text document or
61 | exported directed as a .tex file
62 | }
63 | \description{
64 | Produces a 'LaTeX' output for output obtained via
65 | \code{overview_tab} and \code{overview_crosstab}
66 | }
67 | \examples{
68 | data(toydata)
69 |
70 | overview_object <- overview_tab(dat = toydata, id = ccode, time = year)
71 | overview_latex(
72 | obj = overview_object,
73 | title = "Some nice title",
74 | crosstab = FALSE
75 | )
76 |
77 | #' overview_object <- overview_tab(dat = toydata, id = ccode, time = year)
78 | overview_latex(
79 | obj = overview_object,
80 | title = "Some nice title",
81 | file_path = "some/path_to/your_output_file.tex"
82 | )
83 |
84 | overview_ct_object <- overview_crosstab(
85 | dat = toydata,
86 | cond1 = gdp,
87 | cond2 = population,
88 | threshold1 = 25000,
89 | threshold2 = 27000,
90 | id = ccode,
91 | time = year
92 | )
93 | overview_latex(
94 | obj = overview_ct_object,
95 | title = "Some nice title for a cross tab",
96 | crosstab = TRUE,
97 | cond1 = "Name of first condition",
98 | cond2 = "Name of second condition"
99 | )
100 | }
101 |
--------------------------------------------------------------------------------
/man/overview_na.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_na.R
3 | \name{overview_na}
4 | \alias{overview_na}
5 | \title{overview_na}
6 | \usage{
7 | overview_na(
8 | dat,
9 | yaxis = "Variables",
10 | perc = TRUE,
11 | row_wise = FALSE,
12 | add = FALSE
13 | )
14 | }
15 | \arguments{
16 | \item{dat}{Your data set}
17 |
18 | \item{yaxis}{Label of your y axis ("Variables" is default)}
19 |
20 | \item{perc}{If TRUE (default) plot returns the number of NAs in percentage}
21 |
22 | \item{row_wise}{If TRUE (FALSE is default) plot return the number of NAs
23 | per row}
24 |
25 | \item{add}{If TRUE (FALSE is default) it generates a new data frame with
26 | na_count and percentage share of NAs for each row}
27 | }
28 | \value{
29 | Depending on the selection, the function returns a ggplot figure that
30 | presents the distribution of NAs in the data set or adds the information
31 | on the row-wise NA share
32 | }
33 | \description{
34 | This function plots a ggplot to visualize the distribution of
35 | NAs across all variables in the data set.
36 | }
37 | \examples{
38 | data(toydata)
39 | overview_na(toydata, perc = FALSE)
40 | }
41 |
--------------------------------------------------------------------------------
/man/overview_overlap.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_overlap.R
3 | \name{overview_overlap}
4 | \alias{overview_overlap}
5 | \title{overview_overlap}
6 | \usage{
7 | overview_overlap(
8 | dat1,
9 | dat2,
10 | dat1_id,
11 | dat2_id,
12 | dat1_name = "Data set 1",
13 | dat2_name = "Data set 2",
14 | plot_type = "bar"
15 | )
16 | }
17 | \arguments{
18 | \item{dat1}{A first data set object}
19 |
20 | \item{dat2}{A second data set object}
21 |
22 | \item{dat1_id}{Scope (e.g., country codes or individual IDs) of dat1.
23 | It is important that both ID variables are exactly the same to generate
24 | the perfect match.}
25 |
26 | \item{dat2_id}{Scope (e.g., country codes or individual IDs) of dat2.
27 | It is important that both ID variables are exactly the same to generate
28 | the perfect match.}
29 |
30 | \item{dat1_name}{Name of dat1 ("Data set 1" is the default)}
31 |
32 | \item{dat2_name}{Name of dat2 ("Data set 2" is the default)}
33 |
34 | \item{plot_type}{Type of plot ("bar" and "venn" are the two options) "venn"
35 | relies on the ggvenn function}
36 | }
37 | \value{
38 | A ggplot2 object (bar chart) that shows the overlap of two data sets.
39 | }
40 | \description{
41 | Provides an overview of the overlap of two data sets.
42 | Cautionary note: This function is currently only preliminary workable
43 | and can only capture 2 data sets. We are working on an extension that
44 | allows to compare multiple data sets.
45 | }
46 | \examples{
47 | \dontrun{
48 | data(toydata)
49 | toydata2 <- toydata[which(toydata$year > 1992), ]
50 | overview_overlap(
51 | dat1 = toydata, dat2 = toydata2, dat1_id = ccode,
52 | dat2_id = ccode
53 | )
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/man/overview_plot.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_plot.R
3 | \name{overview_plot}
4 | \alias{overview_plot}
5 | \title{overview_plot}
6 | \usage{
7 | overview_plot(
8 | dat,
9 | id,
10 | time,
11 | xaxis = "Time frame",
12 | yaxis = "Sample",
13 | asc = TRUE,
14 | color,
15 | dot_size = 2
16 | )
17 | }
18 | \arguments{
19 | \item{dat}{Your data set}
20 |
21 | \item{id}{Your scope (e.g., country codes or individual IDs). If the id
22 | variable contains NAs, they will not be included in the plot.}
23 |
24 | \item{time}{Your time (e.g., time periods given by years, months, ...)}
25 |
26 | \item{xaxis}{Label of the x axis ("Time frame" is default)}
27 |
28 | \item{yaxis}{Label of the y axis ("Sample" is default)}
29 |
30 | \item{asc}{Sorting the y axis in ascending order ("TRUE" is default)}
31 |
32 | \item{color}{Optional argument that defines the color}
33 |
34 | \item{dot_size}{Option argument that defines the dot size (default is 2)}
35 | }
36 | \value{
37 | A ggplot figure that presents the sample information visually
38 | }
39 | \description{
40 | This function plots a ggplot to visualize the distribution of
41 | scope objects across the time frame.
42 | }
43 | \examples{
44 | data(toydata)
45 | overview_plot(dat = toydata, id = ccode, time = year)
46 | }
47 |
--------------------------------------------------------------------------------
/man/overview_plot_absolute.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_plot_absolute.R
3 | \name{overview_plot_absolute}
4 | \alias{overview_plot_absolute}
5 | \title{overview_plot_absolute}
6 | \usage{
7 | overview_plot_absolute(
8 | dat_result = NULL,
9 | theme_plot = NULL,
10 | yaxis = NULL,
11 | xaxis = NULL
12 | )
13 | }
14 | \arguments{
15 | \item{dat_result}{Data frame}
16 |
17 | \item{theme_plot}{Theme for the plot (pre-defined)}
18 |
19 | \item{yaxis}{Name for yaxis}
20 |
21 | \item{xaxis}{Name for xaxix}
22 | }
23 | \value{
24 | The function returns a ggplot
25 | }
26 | \description{
27 | Function used in `overview_na` to plot the absolute share of NA values
28 | }
29 |
--------------------------------------------------------------------------------
/man/overview_plot_percentage.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_plot_percentage.R
3 | \name{overview_plot_percentage}
4 | \alias{overview_plot_percentage}
5 | \title{overview_plot_percentage}
6 | \usage{
7 | overview_plot_percentage(
8 | dat_result = NULL,
9 | theme_plot = NULL,
10 | yaxis = NULL,
11 | xaxis = NULL
12 | )
13 | }
14 | \arguments{
15 | \item{dat_result}{Data frame}
16 |
17 | \item{theme_plot}{Theme for the plot (pre-defined)}
18 |
19 | \item{yaxis}{Name for yaxis}
20 |
21 | \item{xaxis}{Name for xaxix}
22 | }
23 | \value{
24 | The function returns a ggplot
25 | }
26 | \description{
27 | Function used in `overview_na` to plot the percentage share of NA values
28 | }
29 |
--------------------------------------------------------------------------------
/man/overview_tab.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_tab.R
3 | \name{overview_tab}
4 | \alias{overview_tab}
5 | \title{overview_tab}
6 | \usage{
7 | overview_tab(
8 | dat,
9 | id,
10 | time = list(year = NULL, month = NULL, day = NULL),
11 | complex_date = FALSE
12 | )
13 | }
14 | \arguments{
15 | \item{dat}{A data frame or data table object}
16 |
17 | \item{id}{Scope (e.g., country codes or individual IDs)}
18 |
19 | \item{time}{Time (e.g., time periods given by years, months, ...). There are three options to add a date variable: 1) Time can be a character vector containing **one** time variable, 2) a time variable following the YYYY-MM-DD format, or 3) or a list containing multiple time variables (`time = list(year = NULL, month = NULL, day = NULL)`).}
20 |
21 | \item{complex_date}{Boolean argument identifying if there is a more complex (list-wise) date_time parameter (FALSE is the default)}
22 | }
23 | \value{
24 | A data frame object that contains a summary of a sample that
25 | can later be converted to a 'LaTeX' output using \code{overview_latex}
26 | }
27 | \description{
28 | Provides an overview table for the time and scope conditions of
29 | a data set. If a data.table object is provided, the function uses
30 | data.table's syntax to perform the evaluation
31 | }
32 | \examples{
33 | # With version 1 (and also 2):
34 |
35 | data(toydata)
36 | output_table <- overview_tab(dat = toydata, id = ccode, time = year)
37 |
38 | # With version 3:
39 | overview_tab(dat = toydata, id = ccode, time = list(
40 | year = toydata$year,
41 | month = toydata$month, day = toydata$day
42 | ), complex_date = TRUE)
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/man/overview_tab_df.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_tab_df.R
3 | \name{overview_tab_df}
4 | \alias{overview_tab_df}
5 | \title{overview_tab_df}
6 | \usage{
7 | overview_tab_df(dat2 = NULL, dat = NULL, id = NULL, time = NULL)
8 | }
9 | \arguments{
10 | \item{dat2}{Your data set}
11 |
12 | \item{dat}{Your data set}
13 |
14 | \item{id}{Scope (e.g., country codes or individual IDs)}
15 |
16 | \item{time}{Time (e.g., time periods given by years, months, ...). There are three options to add a date variable: 1) Time can be a character vector containing **one** time variable, 2) a time variable following the YYYY-MM-DD format, or 3) or a list containing multiple time variables (`time = list(year = NULL, month = NULL, day = NULL)`).}
17 | }
18 | \value{
19 | A data.frame
20 | }
21 | \description{
22 | Internal function that calculates the `overview_tab` for data.frame objects
23 | }
24 |
--------------------------------------------------------------------------------
/man/overview_tab_dt.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/overview_tab_dt.R
3 | \name{overview_tab_dt}
4 | \alias{overview_tab_dt}
5 | \title{overview_tab_dt}
6 | \usage{
7 | overview_tab_dt(dat = NULL, id = NULL, time = NULL, col_names = NULL)
8 | }
9 | \arguments{
10 | \item{dat}{Your data set}
11 |
12 | \item{id}{Scope (e.g., country codes or individual IDs)}
13 |
14 | \item{time}{Time (e.g., time periods given by years, months, ...). There are three options to add a date variable: 1) Time can be a character vector containing **one** time variable, 2) a time variable following the YYYY-MM-DD format, or 3) or a list containing multiple time variables (`time = list(year = NULL, month = NULL, day = NULL)`).}
15 |
16 | \item{col_names}{The column names (containing id and time)}
17 | }
18 | \value{
19 | A data.table
20 | }
21 | \description{
22 | Internal function that calculates the `overview_tab` for data.table objects
23 | }
24 |
--------------------------------------------------------------------------------
/man/theme_heat_plot.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/theme_heat_plot.R
3 | \name{theme_heat_plot}
4 | \alias{theme_heat_plot}
5 | \title{theme_heat_plot}
6 | \usage{
7 | theme_heat_plot()
8 | }
9 | \value{
10 | A theme for the `overview_heat` plot
11 | }
12 | \description{
13 | Defines the theme for the `overview_heat` plot function
14 | }
15 |
--------------------------------------------------------------------------------
/man/theme_na_plot.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/theme_na_plot.R
3 | \name{theme_na_plot}
4 | \alias{theme_na_plot}
5 | \title{theme_na_plot}
6 | \usage{
7 | theme_na_plot()
8 | }
9 | \value{
10 | A theme for the `overview_na` plot
11 | }
12 | \description{
13 | Defines the theme for the `overview_na` plot function
14 | }
15 |
--------------------------------------------------------------------------------
/man/toydata.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/toydata.R
3 | \docType{data}
4 | \name{toydata}
5 | \alias{toydata}
6 | \title{Cross-sectional data for countries}
7 | \format{
8 | An object of class \code{"data.frame"}
9 | \describe{
10 | \item{ccode}{ISO3 country code (as character) for the countries in the
11 | sample (Angola, Benin, France, Rwanda, and UK)}
12 | \item{year}{A value between 1990 and 1999}
13 | \item{month}{An abbreviation (MMM) for month (character)}
14 | \item{gpd}{A fake value for GDP (randomly generated)}
15 | \item{population}{A fake value for population (randomly generated)}
16 | }
17 | }
18 | \usage{
19 | data(toydata)
20 | }
21 | \description{
22 | Small, artificially generated toy data set that comes in a cross-sectional
23 | format where the unit of analysis is either country-year or
24 | country-year-month. It provides artificial information for five countries
25 | (Angola, Benin, France, Rwanda, and the UK) for a time span from 1990 to
26 | 1999 to illustrate the use of the package.
27 | }
28 | \examples{
29 |
30 | data(toydata)
31 | head(toydata)
32 | }
33 | \references{
34 | This data set was artificially created for the overviewR package.
35 | }
36 | \keyword{datasets}
37 |
--------------------------------------------------------------------------------
/overviewR.Rproj:
--------------------------------------------------------------------------------
1 | Version: 1.0
2 |
3 | RestoreWorkspace: Default
4 | SaveWorkspace: Default
5 | AlwaysSaveHistory: Default
6 |
7 | EnableCodeIndexing: Yes
8 | UseSpacesForTab: Yes
9 | NumSpacesForTab: 2
10 | Encoding: UTF-8
11 |
12 | RnwWeave: Sweave
13 | LaTeX: pdfLaTeX
14 |
15 | AutoAppendNewline: Yes
16 | StripTrailingWhitespace: Yes
17 |
18 | BuildType: Package
19 | PackageUseDevtools: Yes
20 | PackageInstallArgs: --no-multiarch --with-keep.source
21 |
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/pkgdown/favicon/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/pkgdown/favicon/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon-180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/pkgdown/favicon/apple-touch-icon-180x180.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/pkgdown/favicon/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/pkgdown/favicon/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/pkgdown/favicon/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/pkgdown/favicon/apple-touch-icon.png
--------------------------------------------------------------------------------
/pkgdown/favicon/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/pkgdown/favicon/favicon-16x16.png
--------------------------------------------------------------------------------
/pkgdown/favicon/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/pkgdown/favicon/favicon-32x32.png
--------------------------------------------------------------------------------
/pkgdown/favicon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/pkgdown/favicon/favicon.ico
--------------------------------------------------------------------------------
/tests/testthat.R:
--------------------------------------------------------------------------------
1 | library(testthat)
2 | library(overviewR)
3 |
4 | test_check("overviewR")
5 |
--------------------------------------------------------------------------------
/tests/testthat/test-dt_output.R:
--------------------------------------------------------------------------------
1 | test_that("overview_tab() returns same results regardless of using
2 | data.table or data.frame", {
3 | output_table <- overview_tab(dat = toydata, id = ccode, time = year)
4 | toydata_copy <- data.table::copy(toydata)
5 | toydata_dt <- data.table::setDT(toydata_copy)
6 | output_table2 <-
7 | overview_tab(dat = toydata_dt, id = ccode, time = year)
8 | expect_equal(nrow(output_table2), nrow(output_table))
9 | })
10 |
11 | test_that("overview_tab() returns same results regardless of using
12 | data.table or data.frame", {
13 | toydata_no_dup <-
14 | toydata %>%
15 | dplyr::select(ccode, year) %>%
16 | dplyr::group_by(ccode, year) %>%
17 | dplyr::distinct()
18 | output_table <-
19 | overview_tab(dat = toydata_no_dup, id = ccode, time = year)
20 | toydata_no_dup_copy <- data.table::copy(toydata_no_dup)
21 | toydata_dt <- data.table::setDT(toydata_no_dup_copy)
22 | output_table2 <-
23 | overview_tab(dat = toydata_dt, id = ccode, time = year)
24 | expect_equal(nrow(output_table2), nrow(output_table))
25 | })
26 |
27 | test_that("overview_na() returns same results regardless of using data.table
28 | or data.frame", {
29 | output <- overview_na(dat = toydata)
30 | toydata_copy <- data.table::copy(toydata)
31 | toydata_dt <- data.table::setDT(toydata_copy)
32 | output2 <- overview_na(dat = toydata_dt)
33 | testthat::expect_is(output2, "ggplot")
34 | testthat::expect_is(output, "ggplot")
35 | })
36 |
37 | test_that(
38 | "overview_na() returns same results regardless of using data.table
39 | or data.frame (row_wise=TRUE)",
40 | {
41 | output <- overview_na(dat = toydata, row_wise = TRUE)
42 | toydata_copy <- data.table::copy(toydata)
43 | toydata_dt <- data.table::setDT(toydata_copy)
44 | output2 <-
45 | overview_na(dat = toydata_dt, row_wise = TRUE)
46 | testthat::expect_is(output2, "ggplot")
47 | testthat::expect_is(output, "ggplot")
48 | }
49 | )
50 |
51 | test_that(
52 | "overview_na() returns same results regardless of using data.table
53 | or data.frame (add=TRUE)",
54 | {
55 | output <- overview_na(dat = toydata, row_wise = TRUE, add = TRUE)
56 | toydata_copy <- data.table::copy(toydata)
57 | toydata_dt <- data.table::setDT(toydata_copy)
58 | output2 <-
59 | overview_na(dat = toydata_dt, row_wise = TRUE, add = TRUE)
60 | testthat::expect_is(output2, "data.frame")
61 | testthat::expect_is(output, "data.frame")
62 | }
63 | )
64 |
65 | test_that("check output of overview_heat with dt", {
66 | toydata_copy <- data.table::copy(toydata)
67 | toydata_dt <- data.table::setDT(toydata_copy)
68 |
69 | plot_heat <-
70 | overview_heat(toydata_dt,
71 | ccode,
72 | year,
73 | perc = TRUE,
74 | exp_total = 12
75 | )
76 | testthat::expect_is(plot_heat, "ggplot")
77 | plot_heat_abs <-
78 | overview_heat(toydata_dt, ccode, year, perc = FALSE)
79 | testthat::expect_is(plot_heat_abs, "ggplot")
80 | })
81 |
82 | test_that("for complex_date in overview_tab", {
83 | toydata_copy <- data.table::copy(toydata)
84 | toydata_dt <- data.table::setDT(toydata_copy)
85 |
86 | output_table <-
87 | overview_tab(
88 | dat = toydata,
89 | id = ccode,
90 | time = list(
91 | year = toydata$year,
92 | month = toydata$month,
93 | day = toydata$day
94 | ),
95 | complex_date = TRUE
96 | )
97 | output_table2 <-
98 | overview_tab(
99 | dat = toydata_dt,
100 | id = ccode,
101 | time = list(
102 | year = toydata_dt$year,
103 | month = toydata_dt$month,
104 | day = toydata_dt$day
105 | ),
106 | complex_date = TRUE
107 | )
108 | expect_equal(nrow(output_table2), nrow(output_table))
109 | })
110 |
111 |
112 | test_that("Get a warning message from overview_tab", {
113 | data_test <- toydata %>%
114 | dplyr::mutate(ccode = ifelse(ccode == "RWA", NA, ccode))
115 |
116 | toydata_copy <- data.table::copy(data_test)
117 | toydata_dt <- data.table::setDT(toydata_copy)
118 |
119 | expect_warning(
120 | overview_tab(dat = toydata_dt, id = ccode, time = year)
121 | )
122 | })
123 |
--------------------------------------------------------------------------------
/vignettes/ex1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/vignettes/ex1.png
--------------------------------------------------------------------------------
/vignettes/ex2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/vignettes/ex2.png
--------------------------------------------------------------------------------
/vignettes/ex3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/vignettes/ex3.png
--------------------------------------------------------------------------------
/vignettes/extension1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/vignettes/extension1.png
--------------------------------------------------------------------------------
/vignettes/getting-started.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Getting started"
3 | description: >
4 | Learn what overviewR is about
5 | output: rmarkdown::html_vignette
6 | vignette: >
7 | %\VignetteIndexEntry{Getting started}
8 | %\VignetteEngine{knitr::rmarkdown}
9 | %\VignetteEncoding{UTF-8}
10 | ---
11 |
12 |
13 | ## What is overviewR?
14 |
15 | overviewR is a small yet powerful package that helps you to **get an overview** – hence, the name – **of your data** with particular emphasis on the **extent that your distinct units of observation are covered for the entire time frame** of your data set.
16 |
17 |
18 | ## How can you install it?
19 |
20 | A stable version of `overviewR` can be directly accessed on CRAN:
21 | ```{r, eval=FALSE}
22 | install.packages("overviewR", force = TRUE)
23 | ```
24 |
25 | To install the latest development version of `overviewR` directly from [GitHub](https://github.com/cosimameyer/overviewR) use:
26 |
27 | ```{r, message=FALSE, warning=FALSE, results = "hide", eval=FALSE}
28 | library(devtools)
29 | devtools::install_github("cosimameyer/overviewR")
30 | ```
31 |
32 |
33 | ## Why did we build it?
34 |
35 | If you have a (large) data set that has many different observations over a long period, it becomes increasingly **difficult to identify for each unique observation its exact coverage in the data**. In particular, if some observations are not included for the entire time span of the data – either because they entered later, dropped out earlier or have gaps in between – it can become difficult to spot potential problems in your data’s time and scope.
36 |
37 | overviewR allows you to **quickly get a glimpse of your data and the distribution of your observations over time**. With its ability to **produce both data.frame objects and LaTeX/.tex outputs**, it can be used by **practitioners and academics alike**.
38 |
39 | ## How can it be used?
40 |
41 | overviewR can be used by everyone who works with data that have **time-and-scope characteristics**. That is, all data that contains different units of observation over a specific period will benefit from overviewR. To get a quick overview of **which units** – think of countries, companies, test persons, etc. – **are present or missing during a given time span** – think of years, months, days, minutes, etc. – overviewR provides an **easy and intuitive insight** into the set-up of your data.
42 |
43 | Consider a data set that covers countries over the past 50 years. **Not all countries existed throughout the entire period** – some dissolved, others were newly founded and yet for others, data might not be available for the entire period. Before starting any analysis, it is helpful to get an overview not only of which countries are included and what the entire time span is but also to **see which countries are present at which points in time**. In other words, are there missing data for certain countries at different points in time?
44 |
45 | To get a quick and intuitive overview of your data, overviewR provides currently the following basic functions:
46 |
47 | - **overview_tab** generates a basic table that lists all unique units of observation (e.g., countries) and aggregates the time frame at which each unit is present in the data set. This means it also takes into account gaps in the data set, e.g., when there is – for whatever reason – no data available for a country for a few years within the time frame
48 | - **overview_crosstab** generates a similar table but allows you to separate the overview table using two conditions. For instance, you want to know not only at what time points countries are present in your data but also when these countries can be considered to have high or low GDP and can be categorized as having a small or large population size. For this, overview_crosstab is used.
49 | - **overview_latex** takes a table – either generated by overview_tab or overview_crosstab and turns it into a LaTeX output. It even allows you to save the LaTeX output in a ready-to-use .tex file.
50 | - **overview_plot** visualizes the time and scope conditions of your data in a ggplot plot. For each scope object in your data (e.g., countries) on the y-axis, it plots the time coverage (x-axis) as a horizontal line for all time points in your data. This helps to spot gaps in your data for specific scope objects or simply creates a graphical display of your time and scope conditions and can be a good companion for presentation slides or appendices.
51 | overview_crossplot is an alternative to visualize a cross table (a way to present results from overview_crosstab)
52 | - **overview_heat** visualizes the coverage of each time and scope combination of your dataset in a heat map style ggplot. Each cell in the heat map is colored based on the coverage of a scope object at a given time point. Additionally, it displays either the total number of cases covered or a relative percentage as plain text. This helps to spot missing information even more nuanced. For instance, in a monthly data set with countries as the scope object, it illustrates the percentage of covered months in the data for each country-year combination.
53 | - **overview_na** graphically illustrates the total number of NAs across all variables in your data set as a horizontal bar plot. Similar to the other plot objects, overview_na returns a ggplot object and can be modified and adjusted accordingly.
54 | - **overview_overlap** provides an overview of the overlap of two data sets
55 |
56 | ## Overview of functional add-ons
57 | | | Works with `data.frame` objects | Works with `data.table` | Can take multiple time arguments (year, month, day) |
58 | |-----------------------|---------------------------------|-------------------------|-----------------------------------------------------|
59 | | `overview_tab` | yes | yes | yes |
60 | | `overview_na` | yes | yes | |
61 | | `overview_plot` | yes | | |
62 | | `overview_crossplot` | yes | | |
63 | | `overview_crosstab` | yes | | |
64 | | `overview_heat` | yes | | |
65 | | `overview_overlap` | yes | | |
66 |
67 |
68 | There is also a [CheatSheet](https://github.com/rstudio/cheatsheets/blob/main/overviewR.pdf) available here that showcases the functions of overviewR.
69 |
70 |
71 | ## Get involved!
72 |
73 | Have you used overviewR in your project? **Let us know!** You can either e-mail us or use our pull-request template and populate/fill the following with your information:
74 |
75 | ```
76 | **PROJECT TITLE**:
77 | --SHORT DESCRIPTION HOW YOU USED OVERVIEWR--
78 | [*LINK TO YOUR WEBSITE*](https://LINK-TO-YOUR-WEBSITE)
79 | ```
80 |
81 | We will feature your project below!
82 |
83 | ## Projects using overviewR
84 |
--------------------------------------------------------------------------------
/vignettes/unnamed-chunk-22-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/vignettes/unnamed-chunk-22-1.png
--------------------------------------------------------------------------------
/vignettes/unnamed-chunk-23-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/vignettes/unnamed-chunk-23-1.png
--------------------------------------------------------------------------------
/vignettes/unnamed-chunk-24-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/vignettes/unnamed-chunk-24-1.png
--------------------------------------------------------------------------------
/vignettes/unnamed-chunk-25-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/vignettes/unnamed-chunk-25-1.png
--------------------------------------------------------------------------------
/vignettes/unnamed-chunk-27-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/vignettes/unnamed-chunk-27-1.png
--------------------------------------------------------------------------------
/vignettes/unnamed-chunk-28-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cosimameyer/overviewR/7552d260a2b781de90b6c99ff9fdeab3a0b56658/vignettes/unnamed-chunk-28-1.png
--------------------------------------------------------------------------------