I am trying to run the gls function but I keep getting this error message:
"Error in model.frame.default(formula = ~var + FS, data = list(MINBIO15 = c(37L, : object is not a matrix"
My data looks like this:
MINBIO15 MAXBIO15 FS
Achyranthes_aspera 37 117 0
Achyropsis_avicularis 28 86 0
Alternanthera_adscendens -999 -999 -999
Alternanthera_brasiliana 33 119 0
Alternanthera_caracasana 35 109 1
Alternanthera_cinerella 105 120 1
...
My script is:
>tree<-read.tree ("tree.phy")
>clima<-read.table("mydata.txt",header=TRUE,na.strings=-999)
>clima<-na.omit(clima)
>match.phylo.data(tree, clima)
>var=(clima$MINBIO15)
> result.br <- gls(var ~ FS, clima, correlation=corBrownian(phy=tree),method="REML")
Data and tree tips match perfectly, and my data is a dataframe
Perhaps you could give some advice on it?