
R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ouch)
> set.seed(1277742405L)
> 
> tree <- with(bimac,ouchtree(node,ancestor,time/max(time),species))
> 
> try(brown(bimac))
Error in brown(bimac) : argument "tree" is missing, with no default
> try(brown(tree=bimac))
Error : in 'brown': 'tree' must be an object of class 'ouchtree'.
> try(brown(tree=tree))
Error in brown(tree = tree) : argument "data" is missing, with no default
> try(brown(tree=tree,data=bimac$size[1:10]))
Error : in 'brown': 'data' vector(s) must be numeric, with one entry per node of the tree.
> try(brown(tree=tree,data=bimac$size))
Error : in 'brown': 'data' vector names (or data-frame row names) must match node names of 'tree'.
> try(brown(tree=tree,data=setNames(c(bimac$size[-c(44,45)],NA,NA),bimac$node)))
Error : in 'brown': missing data on terminal node(s): '44', '45'.
> try(
+   brown(
+     tree=tree,
+     data=as.character(bimac$size)
+   )
+ )
Error : in 'brown': 'data' must be either a single numeric data set or a list of numeric data sets.
> brown(
+   tree=tree,
+   data=list(
+     setNames(bimac$size,bimac$node),
+     setNames(rnorm(n=45),bimac$node)
+   )
+ ) -> m
> brown(
+   tree=tree,
+   data=list(
+     A=setNames(bimac$size,bimac$node),
+     B=setNames(rnorm(n=45),bimac$node)
+   )
+ ) -> m
> update(m,data=setNames(2*bimac$size,bimac$node)) -> m
> 
> names(as.data.frame(m))
[1] "nodes"     "ancestors" "times"     "labels"    "data"     
> 
