Intergration R Markdown
-
- Posts: 3
- Joined: Sat Feb 11, 2017 5:06 pm
Intergration R Markdown
Hello,
Thank you very much for designing this program. It is very user friendly, and uses the power of R. I'm learning R (and statistics) at the moment, and I'm trying to do everything in R Markdown. Is it possible to use the output generated bij Jamovi (or the jmv package, for that matter) in R Markdown? I can't really access the object in the manner that I'm used to, so including tables and figures, and referencing specific values is not really possible at the moment. I'm aware of the fact that copying and pasting in Word is an option, but that's not really science-proof, I think . Plus, not very dynamic, like the rest of the program.
Thank you very much for designing this program. It is very user friendly, and uses the power of R. I'm learning R (and statistics) at the moment, and I'm trying to do everything in R Markdown. Is it possible to use the output generated bij Jamovi (or the jmv package, for that matter) in R Markdown? I can't really access the object in the manner that I'm used to, so including tables and figures, and referencing specific values is not really possible at the moment. I'm aware of the fact that copying and pasting in Word is an option, but that's not really science-proof, I think . Plus, not very dynamic, like the rest of the program.
Re: Intergration R Markdown
hi reinout,
first up, i do apologise, our documentation in this area isn't excellent. you asking has prompted me to think through how we can improve the situation. i'll try and put some good docs up in the coming weeks. in the mean time, i've made you a little .Rmd doc which demonstrates the basics:
https://gist.githubusercontent.com/jona ... titled.Rmd
it's by no means complete, so do come back if you have further questions.
cheers
jonathon
first up, i do apologise, our documentation in this area isn't excellent. you asking has prompted me to think through how we can improve the situation. i'll try and put some good docs up in the coming weeks. in the mean time, i've made you a little .Rmd doc which demonstrates the basics:
https://gist.githubusercontent.com/jona ... titled.Rmd
it's by no means complete, so do come back if you have further questions.
cheers
jonathon
Re: Intergration R Markdown
Thanks, this is already very useful. It would be extremely handy to provide an interface to the tidy() function in the broom package (https://cran.r-project.org/web/packages ... broom.html). It would be a real game changer.
Cheers,
Ron
Cheers,
Ron
Re: Intergration R Markdown
ah! broom looks good!
i'll definitely take a closer look!
i'll definitely take a closer look!
Re: Intergration R Markdown
hey,
in the latest jmvcore 0.5.1 i've improved the situation substantially (inspired by broom)
you can now go: as.data.frame on results tables, and it will give you a data frame.
see the new gist here:
https://gist.github.com/jonathon-love/9 ... 05fee397a7
in the latest jmvcore 0.5.1 i've improved the situation substantially (inspired by broom)
you can now go: as.data.frame on results tables, and it will give you a data frame.
see the new gist here:
https://gist.github.com/jonathon-love/9 ... 05fee397a7
Re: Intergration R Markdown
Hi Jonathon,
This is awesome, thank you so much!
Ron
This is awesome, thank you so much!
Ron
Re: Intergration R Markdown
Hi Jonathon,
The approach outlined above works for main results tables. With repeated measures ANOVA it works for $rmTable. However, I get an error when trying to call as.data.frame() with $postHoc as argument to get to the post hoc tests table. This is the error that is returned:
I am using jmv 0.7.0.6 and jmvcore 0.5.1 on R 3.3.3.
Best,
Ron
The approach outlined above works for main results tables. With repeated measures ANOVA it works for $rmTable. However, I get an error when trying to call as.data.frame() with $postHoc as argument to get to the post hoc tests table. This is the error that is returned:
Code: Select all
Error in as.data.frame.default(x[[i]], optional = TRUE) :
cannot coerce class "c("Array", "ResultsElement", "R6")" to a data.frame
Best,
Ron
Re: Intergration R Markdown
hi ron,
the post hoc object is an array of tables, so try going like this:
cheers
the post hoc object is an array of tables, so try going like this:
Code: Select all
as.data.frame(results$postHoc[[1]])
Re: Intergration R Markdown
Hi Jonathon,
I see, thank you very much!
Best,
Ron
I see, thank you very much!
Best,
Ron
Re: Intergration R Markdown
actually, i might make it a bit smarter, so when you go:
as.data.frame(results$postHoc)
it combines all the post hoc tables into a single data frame.
there's so many levels of refinement you can go to!
as.data.frame(results$postHoc)
it combines all the post hoc tables into a single data frame.
there's so many levels of refinement you can go to!