Section author: Sebastian Jentschke
Rj Editor for jamovi
First you have to install the module Rj from the jamovi library. This will create a «R»-icon in the icon bar.
Running R commands
Click on the «R» icon and select «Rj Editor».
This opens an input field on the left side where you can use R commands.
You can access your dataset with the variable
data. The first line selects
the first three columns of your dataset. Alternatively, you can use variable
names as shown in the second line.
summary(data[1:3]) summary(data[, c(‘var1’, ‘var2’, ‘var3’)])
But you can also use functions from R libraries:
stats::aggregate(as.numeric(data[, ‘var1’]), list(data[, ‘gender’]), mean)
It may take a bit of time to figure out how to use these functions, especially to discover, e.g., which format is required for the data matrices you use as input to functions (those may need to be converted to numbers with «as.numeric» or to a list with «list»). But once you managed that, you have unlimited access to (almost) any kind of statistical analysis you can imagine.
This is not at least because there come already a wealth of R libraries
installed with jamovi and Rj:
Some of these libraries are especially interesting:
statsto get access to a wealth of statistical analyses (e.g.,
stats::glmfor fitting Generalized Linear Models or
stats:kmeansfor running k-means cluster analyses)
lme4to calculate Linear, Generalized Linear, and Nonlinear mixed modells
MASSimplements analyses from Venables og Ripley’s famous book «Modern Applied Statistics with S» (which includes, e.e., linear discriminant analysis
lavaanto run a wide range of analyses with latent variables (incl. confirmatory factor analysis, structural equation modeling and latent growth curve models)
BayesFactorto run several types of Bayes-analyses to complement your «classical» (frequentist) statistics (e.g. the Bayes-equivalent of the t-test; NB: it is of course easier to use the jamovi-module «jsq» for that)
clusterto run several types of cluster analyses
Switch between R-versions
Per default, Rj uses the R-installation that is included with jamovi. For most circumstances this will be sufficient (not the least because quite a wealth of libraries is included; see above). However, there might be occasions where you would like to use the R-installation on your computer; typically, if you want to use libraries that are not included in jamovi’s R-version. To do this, click on the cogwheel symbol in the top-right corner of the Rj-input field. A window opens where you can set whether you would like to use jamovi’s R version («jamovi R» in the dropdown box at the bottom) or your system’s R version («System R»). Please note that currently (Nov 2019), this option is not available for certain system-and-R-version-combinations (e.g., R > 3.4 on Linux).