Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.

オブジェクト不在時の transcribe() がエラー #7

Open
uribo opened this issue Mar 17, 2018 · 1 comment
Open

オブジェクト不在時の transcribe() がエラー #7

uribo opened this issue Mar 17, 2018 · 1 comment
Labels
difficult Long challenging in_japanese 日本語での議論

Comments

@uribo
Copy link
Owner

uribo commented Mar 17, 2018

library(sealr)
transcribe(3.14)
#> The given object is not stored in any environment.
#> The given object is not stored in any environment.
#> Error in eval(parse(text = code, keep.source = FALSE), envir): object 'x' not found
x <- 3.14
transcribe(x)
#> [1] "test_that(\"x\", {expect_is(\nx,\n\"numeric\"\n)\nexpect_length(\nx,\n1L\n)\nexpect_equal(\nunique(x),\n3.14\n)\nexpect_equal(\nrange(x),\nc(3.14, 3.14)\n)})"
transcribe(3.14)
#> [1] "test_that(\"x\", {expect_is(\nx,\n\"numeric\"\n)\nexpect_length(\nx,\n1L\n)\nexpect_equal(\nunique(x),\n3.14\n)\nexpect_equal(\nrange(x),\nc(3.14, 3.14)\n)})"

Created on 2018-03-17 by the reprex package (v0.2.0).

@uribo uribo added the in_japanese 日本語での議論 label Mar 17, 2018
@uribo
Copy link
Owner Author

uribo commented Mar 17, 2018

xを作成した後に成功するのは lobstr::obj_addr() による同一オブジェクトの呼び出しをしているため。

sealr/R/utils.R

Lines 49 to 51 in cecb554

mem = name %>%
purrr::map_chr(
~ lobstr::obj_addr(get(.x))

ダミーでも作れば良いのか?

@uribo uribo added the difficult Long challenging label Mar 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
difficult Long challenging in_japanese 日本語での議論
Projects
None yet
Development

No branches or pull requests

1 participant