tests/testthat/test-python-factors.R

context("factors")

test_that("R factors are converted to character", {
  skip_if_no_python()

  before <- iris$Species
  after <- py_to_r(r_to_py(before))
  expect_equal(as.character(before), after)
})
rstudio/reticulate documentation built on May 25, 2024, 4:14 p.m.