This is how I usually set up the beginning of my #knitr / #quarto scripts to download data from #osf that I then use for analysis in the rest of the script.
This way I only need to share the script, and anybody who wants to #reproduce the results will always get the right datafile.
Let me know if there is a better way to do this!
#R #reproducibility
#ReproducibiliTea #OpenScienceFramework #OpenScience
#reproducibilitea #OpenScience #openscienceframework #reproducibility #r #reproduce #osf #Quarto #knitr
I think I've had a breakthrough on the "portable vignette" problem. The core of it is that knitr has an output.dir option which knitr makes everything relative to (e.g. image paths). The confusing part is that neither rmarkdown::render(output_dir=) nor rmarkdown::render(knit_root_dir=) actually sets this option (?!)
However, if you can find a way to set it, either using parameters or other options, it seems to work?
Full example here: https://github.com/multimeric/KnitrPortable
Major thanks to @tannguyen for spotting and reporting a bug in my niftiPlottingFunctions.R plot.volume() function!
The code at https://osf.io/k8u2c is updated; see https://mvpa.blogspot.com/2023/03/bugfix-for-niftiplottingfunctionsr.html for info and examples.
(This #baseR #rstats function is for plotting #fMRI #nifti images in #knitr documents.)
... it is painful to find out there was a bug, but so much better to fix it than to continue its propagation! I am grateful to @tannguyen and hope anyone else seeing something odd lets me know.
#knitr #nifti #fmri #rstats #baseR
Can anyone help me setting figure options in :python: when calling it via #knitr in :rstats: using #reticulate? #rstats
I'm probably overlooking something obvious because I don't know enough about #python
Details:
https://stackoverflow.com/questions/75590659/set-figure-options-for-python-with-knitr
#knitr #Reticulate #rstats #python
New blog post about candidate questionnaires for local elections. Half of it is about the logistics of getting responses from candidates, the other half is about using #RMarkdown and #knitr to create nicely formatted output for the #MadisonBikes WordPress site. https://haraldkliems.netlify.app/posts/2023-02-18-using-knitr-and-rmarkdown-to-format-google-forms-responses/
#rmarkdown #knitr #madisonbikes
A methods paper of mine is now at https://doi.org/10.3389/fnimg.2023.1070274 . This little #NewNeuroPaper demonstrates human task #fMRI quality control, as part of the FMRI Open QC Project (which I hope to discuss at #OHBM and elsewhere as it wraps up).
Its supplemental (https://doi.org/10.17605/OSF.IO/HT543) may be of interest to #rstats folks, particularly if looking for examples of #baseR #knitr #graphics and/or scripts aiming to minimize dependencies and maximize long-term usability.
#graphics #knitr #baseR #rstats #OHBM #fmri #newneuropaper
@ERDonnachie @tgtads @datamaps
I can't resist a #tidyverse vs. #baseR #rstats thread. 😅
It is totally possible to work without tidyverse, and base R graphics can be incredibly flexible. If you'd like some examples, just this morning I uploaded yet another set of all-base #knitr supplemental files (https://osf.io/ht543), with very pretty (and highly useful) graphics, if I say so myself. (Tidyverse can be ok, but it's not at all required.)
#knitr #rstats #baseR #tidyverse
Good news: #RStats knitr is getting a new progress bar.
With the new release coming in the next few weeks, knitr will no longer flood our consoles with irrelevant information. We'll also be able to use a custom progress bar.
https://yihui.org/en/2023/01/knitr-progress-bar/
@domliebl Nice #baseR graphing introduction!
I use base #rstats pretty much exclusively, and am probably more biased than you are against ggplot ... I used it for a few years when it first came out, but got frustrated by its limitations and the need for constant updating and dependencies.
If you are looking for base R graphics tutorials (plus #knitr), try https://mvpa.blogspot.com/2020/03/introductory-knitr-tutorial.html
#papaja, #rstats and #knitr people: Can you change line spacing and font when knitting to PDF? Been collaborating on a paper, and we've knitted to PDF by default. Ended up just below 40 pages - perfect! But a submission deadline is nearing, and we needed a word version. Turns out it is at 45 pages! Done side-by side comp. Seems the PDF is not Times New Roman. Also, line spacing is different. We get around 27 lines on a PDF page, but 24 in the Word version. Ideas? @FrederikAust
Some news about #knitr for #rstats #rmarkdown : Next version will have a revisited, clean progress bar!
Going to a single-line progress bar when knitting a document, which will only show the progress and the chunk label by default.
Learn more at https://yihui.org/en/2023/01/knitr-progress-bar/ and give it a spin already with dev version!
Some news about #knitr for #rstats #rmarkdown #quartoPub : Next version will have a revisited progress bar!
Learn more at https://yihui.org/en/2023/01/knitr-progress-bar/ and give it a spin already with dev version!
#knitr #rstats #rmarkdown #QuartoPub
Phew, it was a lot of tinkering, but my #flowchart|s for my #thesis came out really nice. Made with the #rstats library #DiagrammeR and #graphviz and rendered with #knitr, #bookdown and #latex via #rstudio .
The #mermaid integration is just broken for latex-based pdfs, which is sad because mermaid is just really nice with its easy syntax. graphviz has at least more power and is embeddable as a vector pdf file.
#flowchart #thesis #rstats #DiagrammeR #graphviz #knitr #Bookdown #latex #rstudio #mermaid
@stefanowitsch @linguistics #Python for dealing with #corpora, #R for #stats, #LaTeX with #knitr for transparency. I use #PowerShell a good amount too when I need to batch process files (e.g., convert a bunch of stereo audio files to mono). Sometimes I like using PowerShell over Python for text normalization over many files just because I've always found the file management syntax in Python clunky (e.g., removing diacritics). Also, let's not forget about #Praat scripting for #phonetics stuff
#python #corpora #r #stats #latex #knitr #powershell #Praat #phonetics
Does anyone knows whether it is possible to pick the environment in which a #QuartoPub R chunk will run?
I'm trying to compile every #AdventOfCode problem in one blogpost, and was thinking about sourcing a script per day. So far, I have not found a #knitr option to do this, but maybe my whole approach is wrong.
#QuartoPub #adventofcode #knitr
Does anyone knows whether it is possible to pick the environment in which a #QuartoPub R chunk will run?
I'm trying to compile every #AdventOfCode problem in one blogpost, and was thinking about sourcing a script per day. So far, I have not found a #knitr option to do this, but maybe my whole approach is wrong.
#QuartoPub #adventofcode #knitr
@SchnepfUwe Maybe adjust the resolution in the #knitr code chunk, or print via rasterImage()?
My #rstats #gifti plotting tutorial (https://osf.io/jftuz) has examples of changing resolution (see chunk "code4").
Here's a snippet of the other strategy:
<<code1, fig.height=4.8, fig.width=7.5, fig.align='center'>>=
plot(0:1, 0:1, type="n", ann=FALSE, axes=FALSE);
rasterImage(readPNG(fname, native=TRUE), 0,0,1,1);
@