Data file not found Error

29 views
Skip to first unread message

Hee Han

unread,
Mar 5, 2025, 10:33:32 PMMar 5
to revbayes-users
Dear Group Members,

I have been trying to estimate lineage specific diversification rate through revbayes, but there's an error in the almost first step. "rb" couldn't read my tree files! I tried several times, but every attempt failed. Here are my scripts:

following tutorial script:
> observed_phylogeny <- readTrees("data/beast_rev.nex")[1]
   Attempting to read the contents of file "beast_rev.nex"
   Did not read the file for the following reason:
   * Data file not found
   Error:       Vector index out of range: 0 of 0

> observed_phylogeny <- readTrees("beast_rev.nex")[1]
   Attempting to read the contents of file "beast_rev.nex"
   Did not read the file for the following reason:
   * Data file not found
   Error:       Vector index out of range: 0 of 0

using trees file:
> observed_phylogeny <- readTrees("data/beast_rev.trees")[1]
   Attempting to read the contents of file "beast_rev.trees"
   Did not read the file for the following reason:
   * Data file not found
   Error:       Vector index out of range: 0 of 0

> observed_phylogeny <- readTrees("beast_rev.trees")[1]
   Attempting to read the contents of file "beast_rev.trees"
   Did not read the file for the following reason:
   * Data file not found
   Error:       Vector index out of range: 0 of 0

typing track to file:
> observed_phylogeny <- readTrees("C:\Study\Tools\revbayes-v1.2.5\bin\beast_rev.nex")[1]
   Attempting to read the contents of file "tudyoolsevbayes-v1.2.5ineast_rev.nex"
   Did not read the file for the following reason:
   * Data file not found
   Error:       Vector index out of range: 0 of 0

> observed_phylogeny <- readTrees("C:\Study\Tools\revbayes-v1.2.5\bin\beast_rev.trees")[1]
   Attempting to read the contents of file "tudyoolsevbayes-v1.2.5ineast_rev.trees"
   Did not read the file for the following reason:
   * Data file not found
   Error:       Vector index out of range: 0 of 0

using T command:
> T <- readTrees("beast_rev.nex")
   Attempting to read the contents of file "beast_rev.nex"
   Did not read the file for the following reason:
   * Data file not found

> T <- readTrees("beast_rev.trees")
   Attempting to read the contents of file "beast_rev.trees"
   Did not read the file for the following reason:
   * Data file not found

> T <- readTrees("C:\Study\Tools\revbayes-v1.2.5\bin\beast_rev.nex")
   Attempting to read the contents of file "tudyoolsevbayes-v1.2.5ineast_rev.nex"
   Did not read the file for the following reason:
   * Data file not found

RevBayes v.1.2.5, tree files were created from beast's time estimation analysis,
Window

Thanks for reading and every advice!

Best

Hee Han

Benjamin Redelings

unread,
Mar 8, 2025, 10:42:07 PMMar 8
to revbaye...@googlegroups.com
Hi Hee Han,

Revbayes says that the file is not found.  Have you checked that the
file is in the right place?  If it is not in the place that revbayes is
looking for it, then of course revbayes will not be able to find it.

On 3/5/25 10:30 PM, Hee Han wrote:
> *typing track to file:*
> > observed_phylogeny <-
> readTrees("C:\Study\Tools\revbayes-v1.2.5\bin\beast_rev.nex")[1]
>    Attempting to read the contents of file
> "tudyoolsevbayes-v1.2.5ineast_rev.nex"
>    Did not read the file for the following reason:
>    * Data file not found
>    Error:       Vector index out of range: 0 of 0

If you are going to use a backslash (e.g. "\") then you need to actually
write two of them, like
"C:\\Study\\Tools\\revbayes-v1.2.5\\bin\\beast_rev.nex".  This is
because the backslash is used to as an "escape character".  For example
"\t" means TAB, "\n" means END-OF-LINE, and "\\" means "\".

You might also be able to use a forwards slash on windows:
"C:/Study/Tools/revbayes-v1.2.5/bin/beast_rev.nex", but I am not certain.

-BenRI

Reply all
Reply to author
Forward
0 new messages