Error in params_into_BioGeoBEARS_model_object(BioGeoBEARS_model_object, : replacement has length

858 views
Skip to first unread message

Pete Darwin

unread,
Aug 3, 2015, 10:51:21 PM8/3/15
to BioGeoBEARS
Hey there, I'm getting the following error msg and am just wondering what I need to do to resolve it. I've attached the files. The tree was a *BEAST tree with some very short branch lengths that I substituted with 0.001. The analysis gets halfway through and then gives me the error msg pasted below. Any advice would be much appreciated! Cheers

Error in params_into_BioGeoBEARS_model_object(BioGeoBEARS_model_object,  : 
  replacement has length zero
In addition: Warning message:
In (function (npt = min(n + 2L, 2L * n), rhobeg = NA, rhoend = NA,  :
  unused control arguments ignored
sBEASTtree.newick
sBEAST.txt

Nick Matzke

unread,
Aug 3, 2015, 11:11:29 PM8/3/15
to bioge...@googlegroups.com
Hi -- this issue is something minor with counting the free parameters, I think after the main calculations have been done. Very likely this is due to missing one of the source() updates, see:


Nick



--
You received this message because you are subscribed to the Google Groups "BioGeoBEARS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeobears...@googlegroups.com.
To post to this group, send email to bioge...@googlegroups.com.
Visit this group at http://groups.google.com/group/biogeobears.
To view this discussion on the web visit https://groups.google.com/d/msgid/biogeobears/b8bc4977-a9ad-4ba3-b31b-008a9e9f8733%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pete Darwin

unread,
Aug 3, 2015, 11:38:16 PM8/3/15
to BioGeoBEARS, mat...@nimbios.org
Thanks Nick. Turned out you were right. Firewall here where I work won't allow the sources to be used in R so did it on my telephones connection and it works fine now. Cheers.

Frank Koehler

unread,
Dec 11, 2018, 3:25:11 AM12/11/18
to BioGeoBEARS
Hi
I have exactly the same problem. Have downloaded all updated libraries, but the error message stays. 
Pete seemed to have a problem with his firewall, so I also turned my firewall off... still the same.
The scripts worked fine before the update.

I wonder if it was possible to download and locally source the updates from github to prevent the firewall problems?!
Cheers
Frank

Nick Matzke

unread,
Dec 11, 2018, 5:03:54 PM12/11/18
to bioge...@googlegroups.com
Hi -- the firewall issue shouldn't matter all all now that the script uses the GitHub install instead of source() on online files -- assuming you actually successfully installed the updated version from GitHub, *and* removed any old versions installed in R, see hints on doing this: https://groups.google.com/forum/#!searchin/biogeobears/detach%7Csort:date/biogeobears/2f9etrphhmg/0Jg1YIoOBwAJ

But, if you want to download all the updated BioGeoBEARS R files that you used to use source() opn, all you have to do is:

2. Go to the green Clone or download button
3. Click Download Zip
4. Unzip somewhere. The R source files are in the "R" subdirectory
5a. write out a bunch of source() commands to source the exact location on your hard drive for each file, or (easier)
5b. use the BioGeoBEARS sourceall() command to source everything in that R directory

All that said, it would be easier to just make sure the old installs are gone (just keep repeating library(BioGeoBEARS) and the various detach / remove.packages commands at 


...until library(BioGeoBEARS) no longer works, then and then just install the new GitHub version, assuming your firewall lets you install anything from GitHub.

Cheers,
Nick




--
You received this message because you are subscribed to the Google Groups "BioGeoBEARS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeobears...@googlegroups.com.
To post to this group, send email to bioge...@googlegroups.com.

Nicolas Brignone

unread,
Dec 12, 2018, 10:01:11 AM12/12/18
to BioGeoBEARS
Hi,
I have the same problem. So, I did all of this, even I uninstalled R and RStudio from my laptop (and deleted the R folder), then I have installed R/RStudio again. I don't know why I cannot install the version 1.1 of BGB from github; only the version 0.2 from CRAN. 
I'm new in R, and probably because of this I don't know what I'm not doing well.
The files are OK, because both the dated tree and the distribution file are read.
Any suggestions for a new user?
Thanks in advance

Nico 

Nick Matzke

unread,
Dec 12, 2018, 6:34:12 PM12/12/18
to bioge...@googlegroups.com
Hi,

I can't help if I don't see an error message on the GitHub install.  The instructions to install from GitHub are here: https://github.com/nmatzke/BioGeoBEARS

...pasting below...

========================
(first, install devtools, and MAKE SURE all previous BioGeoBEARS installs are removed, i.e. "library(BioGeoBEARS)" should return an error indicating no package)

...then...

library(devtools)
devtools::install_github(repo="nmatzke/BioGeoBEARS")
========================

The BioGeoBEARS R package is "pure R" and so should install very easily (no compilers etc. needed).

Cheers,
Nick





Nicolas Brignone

unread,
Dec 13, 2018, 6:38:02 AM12/13/18
to bioge...@googlegroups.com
Hi Nick,

Thanks for your reply.

First, I uninstalled BioGeoBEARS, rexpokit and cladoRcpp.
Then, I have installed again rexpokit and cladoRcpp, as is indicated at https://github.com/nmatzke/BioGeoBEARS.
This message appears:

> library(devtools)
> devtools::install_github(repo="nmatzke/BioGeoBEARS")
Downloading GitHub repo nmatzke/BioGeoBEARS@master
These packages have more recent versions available.
Which would you like to update?

1:   rexpokit  (0.26.6 -> 1701a011b...) [GitHub]
2:   cladoRcpp (0.15.1 -> 202e0a393...) [GitHub]
3:   CRAN packages only
4:   All
5:   None

Enter one or more numbers separated by spaces, or an empty line to cancel
1: 

I don´t know what set, because I have already installed rexpokit and cladoRcpp.
If I leave empty the line (so, I press enter), this message appears:

√  checking for file 'C:\Users\Nicolás\AppData\Local\Temp\RtmpYTBmsJ\remotes10246d20a7a\nmatzke-BioGeoBEARS-6780624/DESCRIPTION' ...
-  preparing 'BioGeoBEARS': (2.3s)
√  checking DESCRIPTION meta-information ... 
   Warning in .write_description(db, ldpath) :
     Unknown encoding with non-ASCII data: converting to ASCII
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'BioGeoBEARS_1.1.1.tar.gz'
   Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     'BioGeoBEARS/inst/extdata/examples/BSM_3taxa/M3areas_allowed/3taxa_BAYAREALIKE+J_M3_areasallowed_v1.Rdata'
   Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     'BioGeoBEARS/inst/extdata/examples/BSM_3taxa/M3areas_allowed/3taxa_BAYAREALIKE_M3_areasallowed_v1.Rdata'
   Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     'BioGeoBEARS/inst/extdata/examples/BSM_3taxa/M3areas_allowed/3taxa_BAYAREALIKE_vs_BAYAREALIKE+J_M3_areasallowed_v1.pdf'
   Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     'BioGeoBEARS/inst/extdata/examples/BSM_3taxa/M3areas_allowed/3taxa_DEC_vs_DEC+J_M3_areasallowed_v1.pdf'
   Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     'BioGeoBEARS/inst/extdata/examples/BSM_3taxa/M3areas_allowed/3taxa_DIVALIKE+J_M3_areasallowed_v1.Rdata'
   Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     'BioGeoBEARS/inst/extdata/examples/BSM_3taxa/M3areas_allowed/3taxa_DIVALIKE_vs_DIVALIKE+J_M3_areasallowed_v1.pdf'
   Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     'BioGeoBEARS/inst/extdata/examples/BSM_3taxa/M3areas_allowed/DEC+J_M3areas_allowed_histograms_of_event_counts.pdf'
   Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     'BioGeoBEARS/inst/extdata/examples/BSM_3taxa/M3areas_allowed/DEC+J_M3areas_allowed_single_stochastic_map_n1.pdf'
   
Installing package into ‘C:/Users/Nicolás/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package 'BioGeoBEARS' ...
Warning in file(file, if (append) "a" else "w") :
  cannot open file 'C:/Users/Nicolas/Documents/R/win-library/3.5/BioGeoBEARS/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") : 
  no se puede abrir la conexión
ERROR: installing package DESCRIPTION failed for package 'BioGeoBEARS'
* removing 'C:/Users/Nicolás/Documents/R/win-library/3.5/BioGeoBEARS'
In R CMD INSTALL
Error in i.p(...) : 
  (converted from warning) installation of package ‘C:/Users/NICOLS~1/AppData/Local/Temp/RtmpYTBmsJ/file10246ff45f3c/BioGeoBEARS_1.1.1.tar.gz’ had non-zero exit status

I understand that BGB is not installed. Also, I checked it, using library("BioGeoBEARS") and an error message appears. 

On the other hand, if I set for example the optin number 4 (All), this message appears:

> library(devtools)
> devtools::install_github(repo="nmatzke/BioGeoBEARS")
Downloading GitHub repo nmatzke/BioGeoBEARS@master
These packages have more recent versions available.
Which would you like to update?

1:   rexpokit  (0.26.6 -> 1701a011b...) [GitHub]
2:   cladoRcpp (0.15.1 -> 202e0a393...) [GitHub]
3:   CRAN packages only
4:   All
5:   None

Enter one or more numbers separated by spaces, or an empty line to cancel
1: 4
rexpokit  (0.26.6 -> 1701a011b...) [GitHub]
cladoRcpp (0.15.1 -> 202e0a393...) [GitHub]
Downloading GitHub repo nmatzke/rexpokit@master
√  checking for file 'C:\Users\Nicolás\AppData\Local\Temp\RtmpYTBmsJ\remotes10246a4878d4\nmatzke-rexpokit-1701a01/DESCRIPTION' ...
-  preparing 'rexpokit': (576ms)
√  checking DESCRIPTION meta-information ...
-  cleaning src
   Warning in .write_description(db, ldpath) :
     Unknown encoding with non-ASCII data: converting to ASCII
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'rexpokit_0.26.6.0.9001.tar.gz'
   Warning: file 'rexpokit/cleanup' did not have execute permissions: corrected
   
Installing package into ‘C:/Users/Nicolás/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package 'rexpokit' ...
Warning in file(file, if (append) "a" else "w") :
  cannot open file 'C:/Users/Nicolas/Documents/R/win-library/3.5/rexpokit/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") : 
  no se puede abrir la conexión
ERROR: installing package DESCRIPTION failed for package 'rexpokit'
* removing 'C:/Users/Nicolás/Documents/R/win-library/3.5/rexpokit'
* restoring previous 'C:/Users/Nicolás/Documents/R/win-library/3.5/rexpokit'
In R CMD INSTALL
Error in i.p(...) : 
  (converted from warning) installation of package ‘C:/Users/NICOLS~1/AppData/Local/Temp/RtmpYTBmsJ/file1024b7b7a1/rexpokit_0.26.6.0.9001.tar.gz’ had non-zero exit status 

I don't know what to do. What am I doing wrong?

Thanks in advance,

Nico

Nick Matzke

unread,
Dec 13, 2018, 3:28:38 PM12/13/18
to bioge...@googlegroups.com
Hi -- thanks for the message.

As you have already installed rexpokit and cladoRcpp from CRAN, you should choose option "5: None" when GitHub asks if you want to update other packages.

But, I think the main problem is that, on Windows, there is some kind of limit of the length of file paths, and I accidentally uploaded some test file results into GitHub. I will delete those now, then you can re-try.

Cheers!
Nick

Nick Matzke

unread,
Dec 13, 2018, 3:34:12 PM12/13/18
to bioge...@googlegroups.com
OK, try it now. Cheers!
Nick

(PS: background: 
rexpokit -- the updated version is at both CRAN and GitHub, but the CRAN version is much easier to install as it contains FORTRAN
cladoRcpp -- the updated version is at both CRAN and GitHub, but the CRAN version is much easier to install as it contains C++
BioGeoBEARS -- the updated version is only at GitHub, but is "pure R" so is (should be) easy to install from GitHub
)

Nicolas Brignone

unread,
Dec 15, 2018, 12:34:39 PM12/15/18
to BioGeoBEARS
Hi Nick!
I my case, it still doesn't work :'(
Again the same error message

> library(devtools)
> devtools::install_github(repo="nmatzke/BioGeoBEARS")
Downloading GitHub repo nmatzke/BioGeoBEARS@master
These packages have more recent versions available.
Which would you like to update?

1:   rexpokit  (0.26.6 -> 1701a011b...) [GitHub]
2:   cladoRcpp (0.15.1 -> 202e0a393...) [GitHub]
3:   CRAN packages only
4:   All
5:   None

Enter one or more numbers separated by spaces, or an empty line to cancel
1: 5
√  checking for file 'C:\Users\Nicolás\AppData\Local\Temp\RtmpCubXwD\remotes5b0f0b1d69\nmatzke-BioGeoBEARS-dbb372b/DESCRIPTION' ... 
-  preparing 'BioGeoBEARS': (2.5s)
√  checking DESCRIPTION meta-information ... 
   Warning in .write_description(db, ldpath) :
     Unknown encoding with non-ASCII data: converting to ASCII
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'BioGeoBEARS_1.1.1.tar.gz'
   
Installing package into ‘C:/Users/Nicolás/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package 'BioGeoBEARS' ...
Warning in file(file, if (append) "a" else "w") :
  cannot open file 'C:/Users/Nicolas/Documents/R/win-library/3.5/BioGeoBEARS/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") : 
  no se puede abrir la conexión
ERROR: installing package DESCRIPTION failed for package 'BioGeoBEARS'
* removing 'C:/Users/Nicolás/Documents/R/win-library/3.5/BioGeoBEARS'
In R CMD INSTALL
Error in i.p(...) : 
  (converted from warning) installation of package ‘C:/Users/NICOLS~1/AppData/Local/Temp/RtmpCubXwD/file5b0d757d68/BioGeoBEARS_1.1.1.tar.gz’ had non-zero exit status

I don't know what else to try :(

Nick Matzke

unread,
Dec 16, 2018, 8:48:22 AM12/16/18
to bioge...@googlegroups.com
It looks like there may be a non-ASCII character in the DESCRIPTION file which weirds out your system for some reason.  This surprises me as I typically use a plain-text editor, but I can see. I am traveling but I can attempt to fix this in a day or two.

Cheers!
Nick


Nick Matzke

unread,
Dec 16, 2018, 10:04:24 PM12/16/18
to BioGeoBEARS
OK, I updated the DESCRIPTION file, ensuring the lines are broken up and that it is pure ASCII (I think it was before).

So, try repeating the install procedure and let us know what you get.

Cheers!
Nick

To unsubscribe from this group and stop receiving emails from it, send an email to biogeobears+unsubscribe@googlegroups.com.

Kevin Rowe

unread,
Dec 17, 2018, 12:52:48 AM12/17/18
to BioGeoBEARS
Hi Nick,

I am getting the following error when running the github install...

> devtools::install_github(repo="nmatzke/BioGeoBEARS")
Error in read.dcf(path) : 
  Line starting '(ancestral geographi ...' is malformed!

Seemed to work for me earlier today, but I realised I needed to update R and other packages. Now I can't install BGB.

Cheers,
Kevin 

Nick Matzke

unread,
Dec 17, 2018, 5:34:59 AM12/17/18
to bioge...@googlegroups.com

Nick Matzke <n.ma...@auckland.ac.nz>

9:34 PM (0 minutes ago)
to biogeobears
Well, "(ancestral geographi" is the beginning of the first line break I introduced. I wouldn't have thought it would matter either way, but I'll change it back.

OK, try again now.

Cheers!
Nick


Kevin Rowe

unread,
Dec 18, 2018, 4:06:36 PM12/18/18
to bioge...@googlegroups.com
Hi Nick,

Sorry was away from my computer yesterday. Working now. Thanks.

Kevin

You received this message because you are subscribed to a topic in the Google Groups "BioGeoBEARS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/biogeobears/387A4KLHVTY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to biogeobears...@googlegroups.com.

To post to this group, send email to bioge...@googlegroups.com.
Visit this group at https://groups.google.com/group/biogeobears.

Renata Pirani

unread,
Dec 19, 2018, 11:16:12 AM12/19/18
to BioGeoBEARS
Hi Nick, 

I had a very similar problem. I was checking this post and I did everything above and the same error still happening. When I run the code: 

## Execute the analysis
> dec.results = bears_optim_run(dec.run)
Read 10 items
Read 34 items
     d    e a b x u j ysv ys y s v mx01 mx01j mx01y mx01s mx01v mx01r  mf dp fdp
1 0.01 0.01 0 1 0 0 0   3  2 1 1 1    0     0     0     0     0   0.5 0.1  1   0
       LnL
1 -123.169
Maximizing -- use negfn and neggr
     d    e a b x u j ysv ys y s v mx01 mx01j mx01y mx01s mx01v mx01r  mf dp fdp
1 0.01 0.01 0 1 0 0 0   3  2 1 1 1    0     0     0     0     0   0.5 0.1  1   0
       LnL
1 -123.169
Error in BioGeoBEARS_model_object@params_table$est[free_params_TF] <- params : 
  replacement has length zero 


I really appreciate ay help. Thank you!!!

Nick Matzke

unread,
Dec 19, 2018, 6:41:45 PM12/19/18
to bioge...@googlegroups.com
Hi, 2 thoughts:

1. Make sure all these work (and install.packages them if they don't)

library(minqa)
library(optimx)
library(GenSA)

2. See also this thread, especially ways to make sure you don't have an old install of BioGeoBEARS hiding out causing problems:


...everyone has always eventually gotten it working after trying these things I think...

Cheers!
Nick



Kevin Rowe

unread,
Dec 19, 2018, 6:52:43 PM12/19/18
to bioge...@googlegroups.com
Hi Nick and Renata,

I had the same problems. I followed the links and removed and reinstalled BioGeoBears and all other packages. Ultimately, I got it working by using a different computer.

Kevin



Renata Pirani

unread,
Dec 20, 2018, 9:58:09 AM12/20/18
to bioge...@googlegroups.com
Hi Nick, 

Thank you so much. It is working now!!! 

Happy holidays everyone!!


For more options, visit https://groups.google.com/d/optout.


--
Renata M. Pirani

PhD.c 
Genetic, Evolution and Conservation Biology Graduate Program
Instituto Nacional de Pesquisas da Amazônia (INPA)
Manaus, AM, Brazil

Rafael Acuña

unread,
Jun 17, 2019, 1:58:30 PM6/17/19
to BioGeoBEARS
Hello Nicolás:

I hope you are doing well. Were you able to solve your issue with the installation?

I was having pretty much the same problem because my username in my computer has a "Ñ" on it. So, I think it is likely you were having problems because of the orthographic accent in the "Á" of your username.

I just created a new account (changing the name of my current account didn't work for me) with a name without without accents, ñ, ç or any symbol that does not exist in english, and voilà, it worked, the only bad thing is that i need to change users, but that is only a minor inconvenient.

Best regards to everyone.

Rafael.
Reply all
Reply to author
Forward
0 new messages