Error of non-numeric argument to binary operator

64 views
Skip to first unread message

Almas Gheyas

unread,
Aug 1, 2024, 8:18:15 AM8/1/24
to dartR
Hi, 
I am getting the following error message with many of the DartR functions.
"Error in p1/p2 : non-numeric argument to binary operator". 

This error appeared with most gl.filter functions (e.g. gl.filter.reproducibility, gl.filter.callrate, gl.filter.maf ) and also with gl.dist.pop. 

My DartR version: 2.9.7 and I am working on Rstudio with R version 4.4.1.  
I have tried the followings to troubleshoot but in all cases the same error-message appeared. 
-  Tried the above commands using the testset.gl
-  Installed the dartR and other necessary packages using: 
             install.packages("dartR")
             library(dartR)
             install.packages("devtools")  
             gl.install.vanilla.dartR()    

   -  I have also tried the dartR functions by installing the developmental version of dartR. 

Any suggestions, what might be the issue and how to fix?
Thank you !
Almas

Jose Luis Mijangos

unread,
Aug 1, 2024, 7:29:29 PM8/1/24
to dartR
Hi Almas,

Please use the dartRverse, see the link below:


We are not maintaining dartR anymore and it will be soon retired. 

Please also install the developing version of dartR.base, as shown below. 

library(dartRverse)
dartRverse_install("dartR.base", repository = "github", branch = "dev")

Cheers,
Luis 

Almas Gheyas

unread,
Aug 2, 2024, 7:54:31 AM8/2/24
to dartR
Hi Luis, 
Thanks for the suggestion.  
When I installed dartVerse package, it shows dartR.base 0.96 to be installed. So I ran the commands with this version but got the same error message "Error in p1/p2 : non-numeric argument to binary operator". 
Then I tried to install the "dev" version of dartR.base from github as you suggested but it did not work. My codes and messages are below. 

Almas

> install.packages("dartRverse")
> library(dartRverse) ********************************************** **** Welcome to dartRverse [Version 1.0.2] **** ********************************************** ── Core dartRverse packages ─────────────────────────────────────────────────────────────────── dartRverse ── dartR.base 0.96 dartR.data 1.0.8 ── Not [yet] installed dartRverse packages ──────────────────────────────────────────────────── dartRverse ── dartR.captive dartR.sim dartR.popgen dartR.spatial dartR.sexlinked  

> gl_flt <- gl.filter.reproducibility(gl, threshold = 0.95) Starting gl.filter.reproducibility Processing genlight object with SNP data Removing loci with repeatability less than 0.95 Error in p1/p2 : non-numeric argument to binary operator > dartRverse_install("dartR.base", rep = "github", branch = "dev") Installing dartR.base from Github from branch [dev] Skipping install of 'dartR.base' from a github remote, the SHA1 (4783ade7) has not changed since last install. Use `force = TRUE` to force installation > dartRverse_install("dartR.base", rep = "github", branch = "dev", force=TRUE) Error in dartRverse_install("dartR.base", rep = "github", branch = "dev", :  
unused argument (force = TRUE) 

Jose Luis Mijangos

unread,
Aug 4, 2024, 11:42:04 PM8/4/24
to dartR
Hi Almas,

If you have a genlight/dartR object in your environment, Rstudio will automatically load the library that created that object and the installation will fail. To avoid this, please install the developing version of dartR in an Rstudio session with an empty Environment.

Here is a link about how you can clear your environment:
Clear the Console and the Environment in R Studio - GeeksforGeeks

Alternatively, if you don't want to remove all your variables and objects from your environment, you can create a new Rstudio project just for this installation.

Please use the below commands to install the developing version of dartR.base and the package patchwork:  

devtools::install_github("green-striped-gecko/dartR.base@dev")
install.packages("patchwork")

Cheers,
Luis 

Almas Gheyas

unread,
Aug 6, 2024, 10:38:40 AM8/6/24
to dartR
Thanks very much Luis. This sorted the problem.
cheers
Almas

Reply all
Reply to author
Forward
0 new messages