jtextor / dagitty

Graphical analysis of structural causal models / graphical causal models.
GNU General Public License v2.0
282 stars 46 forks source link

Error: $ operator is invalid for atomic vectors #23

Closed chubbar1963 closed 4 years ago

chubbar1963 commented 5 years ago

When I run the dagitty function, I get the following error code:

Error: $ operator is invalid for atomic vectors

For example, the following is taken from the dagitty documentation::

g <- dagitty("dag{ 
  a -> b ;
  b -> c ;
  d -> c
 }")

Error: $ operator is invalid for atomic vectors

Traceback:

  1. stop(e)
  2. value[3L]
  3. tryCatchOne(expr, names, parentenv, handlers[[1L]])
  4. tryCatchList(expr, classes, parentenv, handlers)
  5. tryCatch({ .jsassign(xv, as.character(x)) .jsassign(xv, .jsp("GraphParser.parseGuess(global.", xv, ").toString()")) ...
  6. dagitty("dag{ \n a -> b ;\n b -> c ;\n d -> c\n }")

Any thoughts? Thanks!

jtextor commented 5 years ago

Thank you for your message. I am afraid I cannot reproduce this problem, when I paste this code into R it works just fine. Can you please tell me more about your environment, e.g., what does "packageVersion('dagitty')" say and which version of R are you running?

chubbar1963 commented 5 years ago

Here you go. Thanks!

packageVersion('dagitty')

[1] ‘0.2.2’

R.Version()

$platform [1] "x86_64-w64-mingw32"

$arch [1] "x86_64"

$os [1] "mingw32"

$system [1] "x86_64, mingw32"

$status [1] ""

$major [1] "3"

$minor [1] "6.0"

$year [1] "2019"

$month [1] "04"

$day [1] "26"

$svn rev [1] "76424"

$language [1] "R"

$version.string [1] "R version 3.6.0 (2019-04-26)"

$nickname [1] "Planting of a Tree"

jtextor commented 5 years ago

So you're using this on MinGW is that correct? I've never tried that TBH. I have a feeling that the V8 package might be the problem, it's a dependency and it's fairly complex. What do you get when you run "packageVersion('v8')" ?

chubbar1963 commented 5 years ago

packageVersion('v8')

[1] ‘2.2’

As for MinGW, I don't really know. I thought I was running Windows 10

Here's what I get when I open System Information:

OS Name Microsoft Windows 10 Enterprise Version 10.0.17763 Build 17763

jtextor commented 4 years ago

I believe this issue should be fixed now (see related issue #24). Closing it for now.

dibatti5 commented 1 year ago

Im still having this issue, has there been a resolution?