Skip to content
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

How to print single graphs? #2

Open
pdeninis opened this issue May 26, 2022 · 2 comments
Open

How to print single graphs? #2

pdeninis opened this issue May 26, 2022 · 2 comments

Comments

@pdeninis
Copy link

pdeninis commented May 26, 2022

First, and most importantly, thank you for the very interesting package!

I was trying to print the graphs in an instance of R using the function:

tables_and_figs<-plot(design,
                        density     = 100,
                        output      = TRUE,
                        print_plots = TRUE)

but all of the graphs are plotted in the same window (the next plot overwrites the previously printed one). Setting the mfrow parameter in the options does not work since they are ggplot graph.

I tried to watch inside the object to isolate each single plot but the output is longer than the R buffer can contain and I could not.

What is the intended way to get each single graph?
Thank you again.

Paolo

PS It would be useful to have a technical file of the package or a vignette with the description and the working of the functions. Maybe I was unable to search it but all I found was the original paper Grayling and Wason (2020)

Considering its predictably very wide audience, I think that a video-tutorial explaining comparatively the practical significance of all the terms and their relevance in each analysis type and showing them by means of examples would be a most effective tool, too.

Congratulations for your already great result!

@mjg211
Copy link
Owner

mjg211 commented May 26, 2022

Hi Paolo,

If you're working within RStudio you can use the back arrow in a plot pane to navigate to whatever plot you're interested in. Alternatively, you can look in table_and_figs$plots. E.g., you get just the plot of the various error rates with table_and_figs$plots$equal_error.

There is a package vignette, but as yet it doesn't go much beyond the original paper. It is on my to-do list to extend this, along with providing other methods of explanation like video tutorials.

Glad you like the package!

@pdeninis
Copy link
Author

pdeninis commented May 26, 2022

Thank you for the super-fast reply!!

I had tried exactly with:

str(tables_and_figs$plots)

to know the function names of the specific plots, but even to partial the output with the $plots specification was not enough to have it complete!

I will search to know the list of names of the graphs and I'll succeed, using them as you have shown.

EDIT:
It was simpler than I guessed. The code below does the job:

> names(tables_and_figs$plots)
[1] "boundaries"          "equal_power"         "equal_error"         "equal_other"         "equal_sample_size"   "shifted_power"       "shifted_sample_size" "pmf_N" 

My best wishes for your project!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants