jagsAddIn: an RStudio AddIn

I have been aware of the RStudio AddIns for a while now but never really saw the usefulness in them (see here https://rstudio.github.io/rstudioaddins/). To me the benefit of using RStudio is so coding in R is more fun and including more menus and clicking and taking away from the keyboard seemed like a step backwards. I know that some of my VIM colleagues would agree!

However, I came across this GitHub Repo which is an AddIn of AddIns. That is, it has a list of lots of them (https://github.com/daattali/addinslist). What I found potentially useful was those that auto-generate some template code, like the generate Roxygen code from functions does in the dropdown menu.

To this end, I’ve written a small AddIn myself which generates some code for running jags from R. Each session in which I do this more or less uses the same boilerplate code and so I realised that this could actually be useful. Its something like this:

cat("model {
for (i in 1:N) {
data <- list("fdfd")
params <- list("fdfd")
nc <- 1
ns <- 1000
nb <- 100
nt <- 1
bug_out <-
bugs(data = dat,
inits = inits,
parameters.to.save = params,
n.chains = nc,
n.iter = ns,
n.burnin = nb,
n.thin = nt,
working.directory = getwd)

I have since had my AddIn included in the addinslist table so you can see for yourself if it is in fact useful. Visit here https://github.com/n8thangreen/jagsAddIn.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: