NAMESPACE issue?

Everything related to the development of modules in jamovi
Post Reply
paulpearson
Posts: 4
Joined: Sat Feb 24, 2024 9:05 am

NAMESPACE issue?

Post 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
User avatar
jonathon
Posts: 2627
Joined: Fri Jan 27, 2017 10:04 am

Re: NAMESPACE issue?

Post 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
paulpearson
Posts: 4
Joined: Sat Feb 24, 2024 9:05 am

Re: NAMESPACE issue?

Post 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
Post Reply