Skip to content

Commit 6fdca52

Browse files
committed
Add Sample output tab
* New `Sample output`tab added with extracts from the output for Sylvia's grid
1 parent 0354534 commit 6fdca52

File tree

6 files changed

+984
-11
lines changed

6 files changed

+984
-11
lines changed

NEWS.Rmd

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ output: html_document
99
showing how to use the app instead of just a screenshot of the interface, or at least a few more
1010
screenshots indicating the steps to run the analysis
1111

12-
- Also on the exemplification, it woul be nice to have an 'example analysis' in the shiny app (as
13-
another tab), because currently, we can only see any results if we input our own data, which
14-
might be a bit confusing for someone who is exploring the app and maybe doesn't have their own
15-
data yet
16-
1712
## v0.6.1
1813

14+
- New `Sample output`tab added with extracts from the output for Sylvia's grid
1915
- Additional test raising test coverage to over 90%
2016
- Button to load sample data and get started right away without uploading any data
2117
- Update icon names using Font Awesome 6

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Psychologically relevant information can be obtained from the interpretation of
127127
What follows is a shortened example. More comprehensive examples are outlined in our publication.
128128

129129
In the resulting diagram for Sylvia's grid in Figure 3, a construct is indicated by a circle, with
130-
(-) denoting the preferred and (-) the non-preferred pole. The diagram shows three clusters (also
130+
(+) denoting the preferred and (-) the non-preferred pole. The diagram shows three clusters (also
131131
called cliques), indicated by the colored hulls around several constructs. In Sylvia's case, the
132132
three clusters are highly overlapping. Two of these are of particular interest, sharing a 'core' of
133133
three constructs -- '(+) Wild, free *vs* (-) controlled, contained', '(+) Massive sense of space,

inst/shiny/ui.R

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ sidebar <- dashboardSidebar(
8282
sidebarMenu(id = "sidebar",
8383
menuItem("Home", tabName = "tab_start", icon = icon("house")),
8484
menuItem("Method", tabName = "tab_method", icon = icon("info")),
85-
menuItem("Analysis", tabName = "tab_grid", icon = icon("table-cells"))
85+
menuItem("Analysis", tabName = "tab_grid", icon = icon("table-cells")),
86+
menuItem("Sample Output", tabName = "tab_sample", icon = icon("chart-simple"))
8687
)
8788
)
8889

@@ -264,7 +265,8 @@ body <- dashboardBody(
264265
h4("Getting started"),
265266
tags$ul(
266267
tags$li("Under the entry", tags$em("Method"), "in the left sidebar you will find a step-by-step description of the manual process to generate the construct clusters."),
267-
tags$li("To upload and analyse a grid programatically, click on the", tags$em("Analysis"), "entry in the sidebar and follow the instructions.")
268+
tags$li("To upload and analyse a grid programatically, click on the", tags$em("Analysis"), "entry in the sidebar and follow the instructions."),
269+
tags$li("To see an extract of the generated output for Sylivia's grid, click on the", tags$em("Sample Output"), "tab in the sidebar.")
268270
)
269271
),
270272
box(width = NULL,
@@ -380,13 +382,13 @@ body <- dashboardBody(
380382
infos[["excel_input_btn_upload"]], placement = "left"
381383
),
382384
hr(),
383-
p("You can download a sample file", downloadLink(outputId = "download_sample_excel", label = "here."),
385+
p("You can download a sample file (Sylvias's grid)", downloadLink(outputId = "download_sample_excel", label = "here."),
384386
"More datasets can be found",
385387
tags$a(href = "https://doi.org/10.5281/zenodo.3629868", target = "_blank", "here.")),
386388
hr(),
387-
p("To get started right away without any download, load the sample grid by pressing the button below."),
389+
p("To get started right away without any download, load Sylvia's sample grid by pressing the button below."),
388390
tipify(
389-
actionButton("load_sample_data", "Load sample grid"),
391+
actionButton("load_sample_data", "Load Sylvia's sample grid"),
390392
infos[["excel_input_btn_sample"]], placement = "left"
391393
)
392394
)
@@ -487,6 +489,15 @@ body <- dashboardBody(
487489
)
488490
)
489491
)
492+
),
493+
494+
#### __ SAMPLE ####
495+
496+
tabItem(tabName = "tab_sample",
497+
div( id = "tab_sample_output",
498+
# includeMarkdown("www/method.md")
499+
includeHTML("www/example.html")
500+
)
490501
)
491502

492503
) # end tabitems
139 KB
Loading

inst/shiny/www/example.Rmd

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: "Output from sample grid"
3+
output: html_fragment
4+
---
5+
6+
```{r setup, include=FALSE}
7+
knitr::opts_chunk$set(echo = FALSE)
8+
```
9+
10+
# Sample output
11+
12+
The results of the IC analysis are not displayed interactively but are bundled in an MS Excel file
13+
that can be downloaded (see tab `Analysis`). The results of all intermediate IC steps
14+
as described in [Burr, King, and Heckmann (2020)](https://doi.org/10.1080/14780887.2020.1794088) are
15+
contained. The main purpose of the software is to automate the cluster identification step of the IC
16+
procedure (see tab `Method`), which is a cumbersome and error-prone task if performed manually.
17+
Below, an extract of the analysis results for Sylvia's grid are shown. For a more detailed epxlanation,
18+
however, please refer to our publication.
19+
20+
## Input data and results
21+
22+
The input file for Sylvias's grid is available for download on the `Analysis` tab. Figure 1 shows the
23+
raw grid data.
24+
25+
![*Figure 1*: Results of IC method for Sylvia.](sylvia_raw.png){width="60%"}
26+
27+
Figure 2 displayes the network graph of related contructs and discovered construct cliques, the most
28+
relevant part of the output, which is subsequently used for interpretation in the next section.
29+
30+
![*Figure 2*: Results of IC method for Sylvia.](03-analysis-result.png){width="60%"}
31+
32+
## Interpretation
33+
34+
Psychologically relevant information can be obtained from the interpretation of the network graph in
35+
Figure 2. What follows is a shortened example. More comprehensive examples are outlined in our
36+
[publication](https://doi.org/10.1080/14780887.2020.1794088).
37+
38+
In the resulting diagram for Sylvia's grid in Figure 2, a construct is indicated by a circle, with
39+
(+) denoting the preferred and (-) the non-preferred pole. The diagram shows three clusters (also
40+
called cliques), indicated by the colored hulls around several constructs. In Sylvia's case, the
41+
three clusters are highly overlapping. Two of these are of particular interest, sharing a 'core' of
42+
three constructs -- '(+) Wild, free *vs* (-) controlled, contained', '(+) Massive sense of space,
43+
expansive *vs* (-) railed-off, small world' and '(+) Freedom, wildness *vs* (-) conventional', with
44+
(+) indicating the preferred and (-) the non-preferred pole. In one cluster, these three constructs
45+
are strongly associated with '(+) Verdant *vs* (-) dead, nothing thriving'; the association between
46+
her preferred poles suggests that she is drawn to places that are thriving and green, wild and
47+
expansive, as opposed to those which lack life, are small-scale, controlled and conventional.
48+
However, these three constructs share another cluster with the construct '(+) Cosy *vs* (-)
49+
Chaotic', where 'cosy' is her preferred pole. In this cluster, however, her desires for the wild,
50+
free and expansive appear to be in tension with her desire for the 'cosy', as they are aligned with
51+
her non-preferred pole 'chaotic'. The attraction of wild, free spaces for Sylvia is therefore not
52+
straightforward.
53+
54+
The third cluster includes the '(+) Verdant *vs* (-) dead, nothing thriving' construct, which is
55+
here associated with '(+) Exciting, a lot going on *vs* (-) flat, unvarying, depressed,
56+
unenergetic', '(+) Dramatic *vs* (-) unvarying, goes on and on' and '(+) Variable *vs* (-) doesn't
57+
change'. This suggests that to Sylvia 'verdant' spaces are also full of excitement, drama and
58+
variability- they are full of life in these ways. However, the fact that these three constructs do
59+
not cluster with the wild/expansive/freedom constructs indicates that they constitute a somewhat
60+
separate idea for her. A 'wild' space for her need not be 'exciting', for example, although a
61+
'verdant' space is likely to be both exciting and wild. Interpretive clustering therefore gives us
62+
insight into some of the complexity of Sylvia's construing.
63+
64+
```{r include=FALSE}
65+
library(openxlsx)
66+
library(OpenRepGrid.ic)
67+
68+
file <- system.file("extdata", "sylvia.xlsx", package = "OpenRepGrid.ic")
69+
x <- read.xlsx(file)
70+
s <- calculate_similarity(x, min_matches = 6)
71+
```
72+
73+
## Underlying calculations
74+
75+
Also contained in the Excel ouput are the matrices generated in each step of the IC method. Some
76+
details are explained on the `Method` tab. As an example, Table 1 shows the number of matches between constructs, with constructs reversal
77+
beeing allowed. Thus, Construct 2 matches on three elements with Construct 1, on five elements with
78+
Construct 3, on three elements with Construct 4, and so on.
79+
80+
*Table 1:* Number of matches between constructs.
81+
82+
```{r}
83+
knitr::kable(s$R, table.attr = "style='width:60%;'")
84+
```
85+
86+
The matrix of constructs relations is inferred from the matrix of construct matches, here, using a
87+
minimum of 3 matches. The result is displayed in Table 2. A value of `1` denotes a positive, a value
88+
of `-1` a negative construct relation. This matrix is used as a basis to build the network graph from
89+
Figure 2.
90+
91+
*Table 2:* Relations between constructs.
92+
93+
```{r}
94+
knitr::kable(s$D)
95+
```
96+
The examples above give a first insight into the generated output. Yet, to fully understand and work
97+
with the output, it is recommended to consult [Burr, King, and Heckmann (2020)](https://doi.org/10.1080/14780887.2020.1794088)
98+
which outlines the IC method and gives a more thorough interpretation example.

inst/shiny/www/example.html

Lines changed: 868 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)