Page 1 of 1

NAMESPACE issue?

Posted: Wed Feb 28, 2024 9:17 pm
by paulpearson
Hi all,

I'm trying to write a jamovi module for the infer R package. I believe that line 26 of the NAMESPACE file

https://github.com/tidymodels/infer/blob/main/NAMESPACE

for the infer package says that it exports the function named observe. I'm trying to use the infer::observe() function in my R code

https://github.com/paultpearson/infer/b ... riable.b.R

In line 19, I have tried using observe(), infer::observe(), and infer:::observe() and get the following error messages. In jamovi, using Tooth Growth data with response variable len:
  • observe() gives the error "could not find function 'observe'" in jamovi
  • infer::observe() gives the error "'observe' is not an exported object from 'namespace:infer'" in jamovi
  • infer:::observe() gives the error "object 'observe' not found" in jamovi
I have run devtools::document() and jmvtools::install() in the R console for each of these three different ways of invoking the observe function from infer. I'm at a loss for what to try next. Any help is appreciated.

All of my code is in this github repo:

https://github.com/paultpearson/infer/tree/master


Thanks!
Paul

Re: NAMESPACE issue?

Posted: Wed Feb 28, 2024 10:25 pm
by jonathon
hi,

your repo might be private, so i can't see it.

but i wonder if you haven't named your module exactly the same as the R package, and so R doesn't know which package (or guesses incorrectly) which of the two R packages (your module, or the R package) you're trying to use.

change the name of your module to something other than infer, and i think this will go away.

cheers

Re: NAMESPACE issue?

Posted: Thu Feb 29, 2024 7:07 pm
by paulpearson
Hi,

Oof. I really walked head first into a tree, didn't I? You were spot on -- renaming from infer to Inference resolved the issues. I'm sorry if I forgot to make the github repo public (I'll remove it soon because of it's name conflict).

Thanks!
Paul