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)
})

Try the reticulate package in your browser

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

reticulate documentation built on Sept. 11, 2024, 8:31 p.m.