Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Raw File Download
Permalink

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
content badge Iframe embedding
swh:1:cnt:ee721ed3c2dc36024fd8a6c4b6cf5edd924f5b47
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
if (requireNamespace("BayesFactor", quietly = TRUE)) {
  library(BayesFactor)

  set.seed(333)

  context("BF correlation")
  x <- BayesFactor::correlationBF(y = iris$Sepal.Length, x = iris$Sepal.Width)
  test_that("p_direction", {
    testthat::skip_on_travis() # Until insight v3 is released
    expect_equal(as.numeric(p_direction(x)), 0.9225, tol = 1)
  })


  # ---------------------------
  context("BF t.test one sample")
  data(sleep)
  diffScores <- sleep$extra[1:10] - sleep$extra[11:20]
  x <- BayesFactor::ttestBF(x = diffScores)
  test_that("p_direction", {
    testthat::skip_on_travis() # Until insight v3 is released
    expect_equal(as.numeric(p_direction(x)), 0.99675, tol = 1)
  })


  # ---------------------------
  context("BF t.test two samples")
  data(chickwts)
  chickwts <- chickwts[chickwts$feed %in% c("horsebean", "linseed"), ]
  chickwts$feed <- factor(chickwts$feed)
  x <- BayesFactor::ttestBF(formula = weight ~ feed, data = chickwts)
  test_that("p_direction", {
    testthat::skip_on_travis() # Until insight v3 is released
    expect_equal(as.numeric(p_direction(x)), 1, tol = 1)
  })

  # ---------------------------
  context("BF t.test meta-analytic")
  t <- c(-.15, 2.39, 2.42, 2.43)
  N <- c(100, 150, 97, 99)
  x <- BayesFactor::meta.ttestBF(t = t, n1 = N, rscale = 1)
  test_that("p_direction", {
    testthat::skip_on_travis() # Until insight v3 is released
    expect_equal(as.numeric(p_direction(x)), 0.99975, tol = 1)
  })

  # # ---------------------------
  # context("BF ANOVA")
  # data(ToothGrowth)
  # ToothGrowth$dose <- factor(ToothGrowth$dose)
  # levels(ToothGrowth$dose) <- c("Low", "Medium", "High")
  # x <- BayesFactor::anovaBF(len ~ supp*dose, data=ToothGrowth)
  # test_that("p_direction", {
  #   expect_equal(as.numeric(p_direction(x)), 91.9, tol=0.1)
  # })
  #
  # # ---------------------------
  # context("BF ANOVA Random")
  # data(puzzles)
  # x <- BayesFactor::anovaBF(RT ~ shape*color + ID, data = puzzles, whichRandom="ID")
  # test_that("p_direction", {
  #   expect_equal(as.numeric(p_direction(x)), 91.9, tol=0.1)
  # })
  #
  #
  # # ---------------------------
  # context("BF lm")
  # x <- BayesFactor::lmBF(len ~ supp + dose, data = ToothGrowth)
  # test_that("p_direction", {
  #   expect_equal(as.numeric(p_direction(x)), 91.9, tol=0.1)
  # })
  #
  #
  # x2 <- BayesFactor::lmBF(len ~ supp + dose + supp:dose, data = ToothGrowth)
  # x <- x / x2
  # test_that("p_direction", {
  #   expect_equal(as.numeric(p_direction(x)), 91.9, tol=0.1)
  # })
}

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top