Skip to content

Commit

Permalink
fixed bug in as.mulTree + cleaned up manuals
Browse files Browse the repository at this point in the history
  • Loading branch information
TGuillerme committed Aug 17, 2015
1 parent 046c50f commit 917df62
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/as.mulTree.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ as.mulTree<-function(data, trees, species, rand.terms=NULL, clean.data=FALSE) {
}
}
#check if at least of the terms is the phylogeny (i.e. animal)
if(any(match(species, terms_list))) {
if(!is.na(match(species, terms_list))) {
set_rand_terms<-"manual"
} else {
stop("The provided random terms should at least contain the species column (phylogeny).")
Expand Down
2 changes: 1 addition & 1 deletion man/as.mulTree.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ data_table<-rbind(data_table_sp1, data_table_sp2)
##Creates a list of trees
trees_list<-rmtree(5,5, tip.label=LETTERS[1:5])
##Creates the "mulTree" object (with a random term formula)
as.mulTree(data_table, trees_list, species="taxa", rand.terms=~specimen)
as.mulTree(data_table, trees_list, species="taxa", rand.terms=~taxa+specimen)
}


Expand Down
2 changes: 1 addition & 1 deletion man/clean.data.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

\title{Cleans a table/tree to match with a given table/tree}

\description{Cleans data table or "phylo" objects to match the tips of the "phylo" objects with a given data.frame.}
\description{Cleans data table or \code{phylo} objects to match the tips of the \code{phylo} objects with a given \code{data.frame}.}

\usage{
clean.data(taxon, data, tree)
Expand Down
4 changes: 2 additions & 2 deletions man/mulTree.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ file.remove(list.files(pattern="longevity.example"))


## Parallel example
## Loading the snow pacakge
## Loading the snow package
library(snow)
## Running the same MCMCglmm on multiple trees
mulTree(mulTree_data, formula=test_formula, parameters=mcmc_parameters, priors=mcmc_priors, output="longevity.example", ESS = 50, parallel="SOCK")
Expand All @@ -92,7 +92,7 @@ data<-rbind(cbind(data, specimen=rep("spec1",30)),cbind(data, specimen=rep("spec
trees<-clean.data(taxon="species", data, combined_trees)$tree

##Creates the mulTree object
mulTree_data<-as.mulTree(data, trees, species="species", rand.terms=~specimen)
mulTree_data<-as.mulTree(data, trees, species="species", rand.terms=~species+specimen)

##Running MCMCglmm on multiple trees
mulTree(mulTree_data, formula=test_formula, parameters=mcmc_parameters, priors=mcmc_priors, output="longevity.example", ESS = 50)
Expand Down

0 comments on commit 917df62

Please sign in to comment.