Hi there
For the module I'm developing I let users select different options of runnning the test. One of them is common, but suboptimal, so if the user selects this option, I show a note that says this option is generally not recommended. For this recommendation, I want to show a reference, but only if the not-recommended option is selected.
I have attached the reference to a part of the results-table which is only visible when the option is selected. So my r.yaml looks something like this:
```
- name: stat[cc]
title: '<i>z</i>-Value'
type: text
visible: (cc)
refs: [cf]
```
However, the reference is always visible, even when the option is not selected.
To complicate things further: There is another reference, which always needs to be shown.
Is there a way to achieve what I'm trying to do?
Thanks in advance for any tips
How can I show a reference based on a condition?
Re: How can I show a reference based on a condition?
Hey @DStuder,
it might be helpful to have a look at your module, for the suggestions requested.
Is it reachable on github?
Cheers,
Maurizio
it might be helpful to have a look at your module, for the suggestions requested.
Is it reachable on github?
Cheers,
Maurizio
Re: How can I show a reference based on a condition?
Hey Maurizio
Yes, you can find the repo here: https://github.com/DanStuder/jamovi-Projekte
The analysis is in the folder "nonpara" and is called "signtest" (NOT signrank).
It's my first module and I'm not exactly proficient in R, so please excuse the crudeness of the code and the general structure.
Thanks for the help!
Dan
Yes, you can find the repo here: https://github.com/DanStuder/jamovi-Projekte
The analysis is in the folder "nonpara" and is called "signtest" (NOT signrank).
It's my first module and I'm not exactly proficient in R, so please excuse the crudeness of the code and the general structure.
Thanks for the help!
Dan
Re: How can I show a reference based on a condition?
Hey Dan,
it seems to me that the references in your first post are in favor of wilcoxranksum.
So I played with the code in WRS and sent a PR with the small changes.
Feel free to decline it.
Cheers,
Maurizio
Re: How can I show a reference based on a condition?
Hi Maurizio
I ended up merging your PR, the footnotes do seem cleaner than the note. This does however not resolve the references-issue. As you can see in the picture below, in the bottom right it shows a [3], which is the reference for the coin package, which now should NOT be shown. On the other hand, reference [4] is NOT shown but should be, because the CC-option is selected.
So what I'm looking for is a way to enable or disable the references based on certain conditions, i.e. based on which test-type is selected. Also, if all test-types are selected, multiple references should be displayed. It seems to me like only one reference is allowed at a time and they are always visible.
So, any way this could be done?
Best,
Dan
I ended up merging your PR, the footnotes do seem cleaner than the note. This does however not resolve the references-issue. As you can see in the picture below, in the bottom right it shows a [3], which is the reference for the coin package, which now should NOT be shown. On the other hand, reference [4] is NOT shown but should be, because the CC-option is selected.
So what I'm looking for is a way to enable or disable the references based on certain conditions, i.e. based on which test-type is selected. Also, if all test-types are selected, multiple references should be displayed. It seems to me like only one reference is allowed at a time and they are always visible.
So, any way this could be done?
Best,
Dan
Re: How can I show a reference based on a condition?
hi,
welcome to module development, we're keen to make your journey as easy as possible!
i've installed your module and this is what i get:
looking at your yaml file, you've got:
https://github.com/DanStuder/jamovi-Pro ... aml#L7-L10
these refs are attached to the table, so if the table is visible (which it is in this case), then the refs are visible. so this looks to be behaving correctly.
come back to us if any of that doesn't make sense.
cheers
jonathon
welcome to module development, we're keen to make your journey as easy as possible!
i've installed your module and this is what i get:
looking at your yaml file, you've got:
https://github.com/DanStuder/jamovi-Pro ... aml#L7-L10
these refs are attached to the table, so if the table is visible (which it is in this case), then the refs are visible. so this looks to be behaving correctly.
this may be your error here (which is entirely understandable, given that our documentation only scores a B-minus) the visibility of a ref is based on the visibility of the item to which it is attached ... rather than a correspondence between the refs name and an option name.On the other hand, reference [4] is NOT shown but should be, because the CC-option is selected.
come back to us if any of that doesn't make sense.
cheers
jonathon
Re: How can I show a reference based on a condition?
Hey Dan,
there are, but my friend Jth preceded me in answering (from him the light comes before from us ).
Perhaps you may find it useful (if you haven't already) to have a look here at the ancova.b.R code for setting a reference on a condition:
https://github.com/jamovi/jmv/blob/mast ... 70-L174C14
There is a reference change when in the model the selected sum of squares changes from Type 1 ('R') to Type 2 or Type 3 ('car').
However always only one reference in the foot of the table because it is recalled, not from the file, but from those visible in the output of the "References".
The "References" output is only one for all the test references (modules) used for the analyzes of interest and can be displayed or not by the user, by selecting it from the kebab menu on the ribbon.
It's always nice to hear about new modules for jamovi.
Good work,
Maurizio
there are, but my friend Jth preceded me in answering (from him the light comes before from us ).
Perhaps you may find it useful (if you haven't already) to have a look here at the ancova.b.R code for setting a reference on a condition:
https://github.com/jamovi/jmv/blob/mast ... 70-L174C14
There is a reference change when in the model the selected sum of squares changes from Type 1 ('R') to Type 2 or Type 3 ('car').
However always only one reference in the foot of the table because it is recalled, not from the file, but from those visible in the output of the "References".
The "References" output is only one for all the test references (modules) used for the analyzes of interest and can be displayed or not by the user, by selecting it from the kebab menu on the ribbon.
It's always nice to hear about new modules for jamovi.
Good work,
Maurizio
Re: How can I show a reference based on a condition?
Hi guys
Thanks a lot for the time and effort you're taking to help me, I really appreciate it!
In the r.yaml I currently have both refs attached to the top-layer of the table, because I wanted to see if it was even possible to display two refs at the same time. Further down, there are refs attached to the stats-column of each test type, because I assumed that would mean these refs are only visible when said item is.
https://github.com/DanStuder/jamovi-Pro ... r.yaml#L29
From what jonathon says I take it that is correct.
After playing around with the code-bits from anvoca.b.R I realized that the references are displayed correctly, once I close and reopen jamovi. So if I change test-type, the references sometimes change but are for the most part incorrect, but after a restart, they are correct. This is the case both if I set the references within r.yaml and b.R
I then assumed it might have to do with the 'clearWith' property of the table, but after adding every test-type to the tables 'clearWith'-list I still have the same problem.
Now, I could leave it at that and hope that every user closes and reopens their analysis without changing it before exporting the output, but I think you can see how this seems unsatisfactory to me. So is there any other way to "refresh" the references?
Best,
Dan
P.S.: I would consider adding 'setRefs' to this documentation page. This is where I was looking to see if such an option exists.
Thanks a lot for the time and effort you're taking to help me, I really appreciate it!
In the r.yaml I currently have both refs attached to the top-layer of the table, because I wanted to see if it was even possible to display two refs at the same time. Further down, there are refs attached to the stats-column of each test type, because I assumed that would mean these refs are only visible when said item is.
https://github.com/DanStuder/jamovi-Pro ... r.yaml#L29
From what jonathon says I take it that is correct.
After playing around with the code-bits from anvoca.b.R I realized that the references are displayed correctly, once I close and reopen jamovi. So if I change test-type, the references sometimes change but are for the most part incorrect, but after a restart, they are correct. This is the case both if I set the references within r.yaml and b.R
I then assumed it might have to do with the 'clearWith' property of the table, but after adding every test-type to the tables 'clearWith'-list I still have the same problem.
Now, I could leave it at that and hope that every user closes and reopens their analysis without changing it before exporting the output, but I think you can see how this seems unsatisfactory to me. So is there any other way to "refresh" the references?
Best,
Dan
P.S.: I would consider adding 'setRefs' to this documentation page. This is where I was looking to see if such an option exists.
Re: How can I show a reference based on a condition?
hi,
can you provide a video demonstrating this issue? i've had a quick look but haven't been able to reproduce it.
cheers
can you provide a video demonstrating this issue? i've had a quick look but haven't been able to reproduce it.
cheers