tests/testthat/test-ena_wrapper.R

suppressMessages(library(rENA, quietly = T, verbose = F))
context("Test util methods");

library(magrittr)

data(RS.data)
units <- c("UserName", "Condition")
conversation <- c("GroupName")
codes <- c("Data", "Technical.Constraints", "Performance.Parameters",
            "Client.and.Consultant.Requests", "Design.Reasoning",
            "Collaboration")

test_that("Verify group with single unit", {
  test_data <- data.table::data.table(RS.data)
  test_data[UserName == "carl b", GroupName := "MeOnly"]

  set_end <- ena(
      RS.data,
      units = c(units, "GroupName"),
      conversation = conversation,
      codes = codes,
      window.size.back = 4
    )

  testthat::expect_true(all(sapply(set_end$meta.data, is, "ena.metadata")))
  testthat::expect_true(all(sapply(set_end$meta.data[-1, ], is, "ena.metadata")))
})

Try the rENA package in your browser

Any scripts or data that you put into this service are public.

rENA documentation built on May 29, 2024, 2:37 a.m.