How to go about accessing actual data from plots

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
civean
Posts: 2
Joined: Tue Oct 16, 2018 7:53 am

How to go about accessing actual data from plots

Post by civean »

Hello,

I really like the output quality and ease of use of jamovi - finally something I can recommend to students and coworkers less inclined to programming! However, I am trying to figure out some small details that are necessary for using jamovi for actual analysis - I'm sure this can be done in R, but I'm trying to stay "within" jamovi which I think is essential for this audience.

The problem I'm having is actually accessing the exact plotted data in results figures, let's say in the ROC curve for binomial regression. I'm used to python, where I would have new data variables produced as returns from an analysis function, which can be inspected to extract/inspect actual data values. I can't seem to figure this out within jamovi, even when using the Rj environment. Any idea how I would go about it?

Best,
C
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: How to go about accessing actual data from plots

Post by jonathon »

oh yup,

so first you need to navigate the results hierarchy, extract the image, and then access the image's state.

you can run this in the Rj editor (or R) with the Tooth Growth data set.

Code: Select all

results <- jmv::logRegBin(
    data = data,
    dep = "supp",
    covs = c("dose", "len"),
    blocks = list(
        list(
            "dose",
            "len")),
    refLevels = list(
        list(
            var="supp",
            ref="OJ")),
    rocPlot = TRUE)

image <- results$models[[1]]$pred$rocPlot

image$state
cheers
civean
Posts: 2
Joined: Tue Oct 16, 2018 7:53 am

Re: How to go about accessing actual data from plots

Post by civean »

Ah, I see! Thank you, works perfect :)

Would it make sense to have "Copy/save image state" (as option to save image) in the right-click menu for images, to make it more discoverable?

Best,
C
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: How to go about accessing actual data from plots

Post by jonathon »

yeah, that's a good suggestion. we definitely need to do something here.

cheers
Post Reply