-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request]: Add facet + cohort legend strata order in mean plot #1212
Comments
Hi @legrasv, I have a PR going up for this soon so I can tag you for review. I just wanted to confirm if you have any warning message in mind in the case of the |
@ayogasekaram Thank you for working on that, a colleague will test the new function shortly. |
@ayogasekaram I got this error message which I can't debug, it looks like I don't have the function sfun loaded (when I am using browser()), what is this function? how can I get it? |
@legrasv the sfun is s_summary but that default should already be set in the g_lineplot parameters. Let me take a look on my end as well! |
Dear NEST, I found a bug in the code of g_lineplot for the strata: matches <- sapply(unique(df_N[[group_var]]), function(x) unique(df_N[[paste0(group_var, "_N")]])[grepl(paste0("^", x), unique(df_N[[paste0(group_var, "_N")]]))]) in this piece of code, it happens that group_var contains specific regex characters and therefore the grepl will not work, example:
-> I need to tell that "()" are not part of the regex expression. I don't know how we could handle that in general. Here I have the bug with the "(", but it could happen with regex characters such as "+", ".", "[", etc. |
update g_lineplot code to handle special characters in group_var. add test for maintaining factor levels. related to #1212 --------- Signed-off-by: Abinaya Yogasekaram <73252787+ayogasekaram@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
@ayogasekaram can this issue be closed now? |
yes it's been addressed in this PR |
Feature description
Dear NEST,
For a project, we needed to generate a mean plot by Nominal dose (group), but facet by COUNTRY. There was no way of adding a facet to the plot aftewards as the data in the plot is the summarized data with the mean and sd, and the column COUNTRY is lost. We had to manually modify the function so that a second grouping column is kept:
These are the code we added to g_lineplot:
And then with the parameter facetvar in the plot, we could produce our plot.
Would it be possible to code something similar to allow us to produce facets on this plot? please
also the legend was incorrect when using strata:
![image](https://private-user-images.githubusercontent.com/99191912/313733229-6469633c-4d4d-46ee-8a9b-2db5378c3a96.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI1MzQxOTgsIm5iZiI6MTcyMjUzMzg5OCwicGF0aCI6Ii85OTE5MTkxMi8zMTM3MzMyMjktNjQ2OTYzM2MtNGQ0ZC00NmVlLThhOWItMmRiNTM3OGMzYTk2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAxVDE3MzgxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRhYTc2Mzk0NmJjZmU4MWYxOTdhYzkwMDNiYzgzZmE5ZDJmZjA2YWI1Mzg5Y2JmOWFhMGJhOWM5ZTc3N2I3MjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.02wZwxPj9V3Fuz0q9gWWvrAmjcuc5Oq-uJJR9A69b3E)
Could you check this?
issue raised a month ago:
https://insightsengineering.github.io/tlg-catalog/stable/graphs/pharmacokinetic/pkcg03.html
Best regards
Valentin
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: