Dear Dean,
I kindly appreciate your soon answer, try your solution and others, but I am still stuck :(
This is what I tried:
#########################################################################
landmarks=readland.tps("landmarks.tps",readcurves = TRUE,specID="ID")
Procrustes=gpagen(landmarks)
#######################################################
species=read.csv("species.csv", header=T, row.names=1)
species=as.factor(species$species)
is.factor(species)
species2=as.matrix(species)
###############################################
phy=read.tree("phylo.tre")
######################################################################
If read species as factor:
df<-geomorph.data.frame(Procrustes,species=species)
df2=rrpp.data.frame(Procrustes,species=species)
Warning: "Error in rrpp.data.frame(Procrustes, species = species) :
Some input is either dimensionless or inappropriate for data frames"
#########################################################
If read species as matrix
#############################################################
dfa<-geomorph.data.frame(Procrustes,species=species2)
df2a=rrpp.data.frame(Procrustes,species=species2)
Warning: "Error in rrpp.data.frame(Procrustes, species = species) :
Some input is either dimensionless or inappropriate for data frames"
#####################################################
So, I cannot obtain a rrppdataframe directly, reading species
as factor or as a matrix
#################################################
So, lets try to convert the geomorphdataframe into a rrpp.data.frame
#######################################################
rrdf=rrpp.data.frame(df)
rrdm=rrpp.data.frame(dfa)
####################################
class(rrdf)
[1] "rrpp.data.frame"
class(rrdm)
[1] "rrpp.data.frame"
Either as a factor or as a matrix both frames are a rrpp.data.frame
#####################################################
Try to include the tree in the data.frame
class(phy)
[1] "phylo"
####################################################
df3=rrpp.data.frame(rrdf,phy=phy)
Warning "Error in rrpp.data.frame(rrdf, phy = phy) :
Some input is either dimensionless or inappropriate for data frames"
df4=rrpp.data.frame(rrdm,phy=phy)
Warning "Error in rrpp.data.frame(rrdf, phy = phy) :
Some input is either dimensionless or inappropriate for data frames"
#### Then I guess that the problem arise when I try
to include the phylo object, so I convert into a df###
#######################################
tree_df <- fortify(phy)
##################################
df3=rrpp.data.frame(rrdf,phy=tree_df)
Warning"Error in rrpp.data.frame(rrdf, phy = tree_df) :
Inputs have different numbers of observations"
df4=rrpp.data.frame(rrdm,phy=tree_df)
"Error in rrpp.data.frame(rrdm, phy = tree_df) :
Inputs have different numbers of observations"
#########When I tried to merge phylo dataframe into the
original geomorph dataframe the same result###
df<-geomorph.data.frame(Procrustes,species=species,phy=tree_df)
##############################################
Finally, try to convert phylo in a matrix
capm=clade.matrix(phy)
> class(capm)
[1] "clade.matrix"
################Merge phylo matrix into rrpp.dataframe
df3=rrpp.data.frame(rrdf,phy=capm)
Warning"Error in rrpp.data.frame(rrdf, phy = capm) :
Some input is either dimensionless or inappropriate for data frames"
Thanks in advance
Best regards
Omar