Template for a Basic jamovi Module

TL;DR

install.packages('jmvtools', repos=c('https://repo.jamovi.org', 'https://cran.r-project.org'))
  • Install jamovi package family:

suppressPackageStartupMessages({
  if (!requireNamespace('jmvtools'))
  {
    install.packages('jmvtools',
                     repos = c('https://repo.jamovi.org', 'https://cran.r-project.org'))
  }
})
suppressPackageStartupMessages(library('jmvtools'))

suppressPackageStartupMessages({
  if (!requireNamespace('jmv')) {
    install.packages('jmv', dependencies = TRUE)
  }
})
suppressPackageStartupMessages(library('jmv'))

suppressPackageStartupMessages({
  if (!requireNamespace('jmvconnect')) {
    install.packages('jmvconnect', dependencies = TRUE)
  }
})
suppressPackageStartupMessages(library('jmvconnect'))

suppressPackageStartupMessages({
  if (!requireNamespace('jmvcore')) {
    install.packages('jmvcore', dependencies = TRUE)
  }
})
suppressPackageStartupMessages(library('jmvcore'))

suppressPackageStartupMessages({
  if (!require('devtools')) {
    install.packages('devtools')
  }
})
suppressPackageStartupMessages(library('devtools'))
  • Locate jamovi bin folder:

    • windows: jmvtools::check("C://Program Files//jamovi//bin")
      I recommend changing folder name from default jamovi x.x to jamovi
    • mac: jmvtools::check("~/Applications/jamovi.app")
  • devtools::document()

  • jmvtools::prepare(home = β€œC://Program Files//jamovi 2.3.26.0//bin”)

  • Inside this repo folder in R run jmvtools::install()

  • A file named jpwrss.jmo and install this module to jamovi

  • The repo is like an R package except jamovi folder.

  • You need to edit R/...b.R files.

  • run jmvtools::install() again.

  • Let me know how it goes :)

linux needs additional installations

  • linux codes

https://cran.r-project.org/bin/linux/ubuntu/README.html

  • flatpak
flatpak install -y flathub org.freedesktop.Platform//19.08
flatpak install -y flathub org.freedesktop.Sdk//19.08

sudo apt install flatpak
sudo apt install gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.jamovi.jamovi
flatpak run org.jamovi.jamovi
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.freedesktop.Sdk//19.08
flatpak install flathub org.freedesktop.Platform//19.08

sudo apt install flatpak-builder
flatpak-builder --run build_folder org.app.json
  • R
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
sudo apt install r-base r-base-core r-recommended r-base-dev
  • RStudio
sudo apt install '/home/serdarbalci/Downloads/rstudio-1.3.1073-amd64.deb'
  • git
sudo apt install git-all
  • gtk3
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module
  • V8 (I could not make this run)
sudo apt-get install libv8-dev
sudo apt-get install libnode-dev


sudo apt install build-essential
gcc --version
sudo apt-get install gfortran

sudo apt-get install r-base-dev
git status


sudo apt install libcurl4-openssl-dev
sudo apt install libxml2-dev

add analysis

jmvtools::addAnalysis(name = 'neofun', title = 'New Function')

how jamovi module functions?