Per [this]*Pandoc Working Group - #15 by mwra) let’s kick off a new thread on discussing the relationship between Tinderbox and R. I’ve always wanted to learn R.
Using the Termina and Homebrew, I installed R and RStudio (you need both). I think I played running a regression in RE by asking ChatGPT who to run a regression in R. I also asked it how to run a regression. I found that I needed to (got to) install libraries for plotly and ggpplot. Again, chat gave me the instructions for doing this, e.g. ‘install.packages(“plotly”)’. I can see how I can use action code to transform my data into the inputs that R needs to run any visualization. Pretty darn cool! Here is a question, is there a command line that can be sent from TBX to R and then have the result from R return back to TBX? Could it return plat images as well, not just text? For instance, could R send a plat image to the hard drive and return the image path to Tinderbox?
@mwra, might this be a better (different) way than mucking around with the template we were playing with yesterday? I see pros and cons.
Again, I’m just 15 minutes into playing with R, so I have tons of newbie questions. I’ll try to answer them myself in time, but I’ll throw them out here for now.
Successfully exporting task list for gannt charge to hardrive
trigger command to have R run it and save plat to file on harddrive
It the next step is failing me. I’m trying to run an osascript osascript -e 'tell application "Tinderbox 10" to set value of attribute "MediaFileName" of note "FigTest" to "tinderboxplot.png"' and I’m getting this error `"Tinderbox 10 got an error: Can’t set note “FigTest”'. Can TBX respond to an osascript call? Is there something in my script that is wrong? I’m bumbling around in the dark. Any guidance would be most appreciated.
I have used R extensively for nearly 20 years. Definitely what you want to do is doable. RStudio is not strictly necessary to use R, it’s just a nice IDE. Posit has a new one that’s a bit more polyglot built off VSCodium called Positron. But you can write and run R code in whatever text editor you want (vim/emacs/VS Code/etc). RStudio is probably the best at the moment for those who primarily use R and who make use of some of the more advanced R features for compiling literate programming documents. The new big thing in this space (which I know you will be into, @satikusala) is called quarto. It’s a command line program for rendering qmd (quarto markdown, the sucessor to rmarkdown) documents to various outputs via pandoc.
The other thing to know is that most people these days in R use a set of packages called the tidyverse to work with data (e.g. the dplyr, readr, tidyr packages) and make plots (ggplot2). This is in contrast to ‘base’ R, which is out of the box R (while it’s very flexible, the syntax is more clunky and graphic defaults not as visually appealing, for example).
But @satikusala, are you already familiar with Python? If you are, and just starting off with a big personal push into stats, you might want to pause and weigh pros and cons of R vs. Python for stats before you fully commit? There’s another free resource in the same O’Rielly series for this "Python for Data Analysis’ Python for Data Analysis, 3E
Generally the whole O’Rielly stats series is very useful
Personally I’d already gone down the R route, and Python remains on my ‘I really wish I had more time’ list! I’d be interested in any interlinkage with Tinderbox that comes up.
Is there any way we can switch you to Jan. 26. We are going to change the alternating days for the meetups, starting in January, because I have a conflict on the second Saturday of every month.
Perhaps kill two birds with one stone? (to use a thoroughly ecologically unsound metaphor). I don’t know the answer, it just I’ve pondered exactly this dilemma!
I’m a beginner in R, but I use quarto. I’m working on enabling Tinderbox to export for quarto book format ( qmd and yml files). Additionally, I’m implementing input assistance for cross-references using ziplinks and mermaid flowcharts.
This is extremely cool!!! Would you be willing to join a meetup one of these days and walk us through this? Are you in Japan? If so, to make it easier for you, maybe you could join our first Friday of the month APAN meeetup with is 4:00 PM PST/9:00 AM JST. Next one is January 3.
Thank you for inviting me to the meetup. As you may have guessed, I live in Japan. But, I’m very sorry, I can’t speak English. so it’s difficult for me to communicate in real-time.
It will take me some time, but I’d like to create a video explaining how to use it instead.
This popped up in my digest email, and caught my attention.
I’m a proficient long-term R user, and use both RMarkdown and quarto (but never Rstudio, unless I’m teaching), and python as well (mix-and match R and python in a quarto document is great). I’ve never pondered interfacing with with Tinderbox, largely because I’ve never had a use case where it would help. Certainly some of the ideas batted around here about creating images to include in a Tbx document could have nifty applications, though.
I could also see using Tinderbox as a very fancy organizational tool for quarto/Rmarkdown, with a little work to configure the markdown export template for code chunks. Both are dialects of markdown, so that could be feasible.