If data are not sequence alignment an phyDat object then there are generic functions as.phyDat() in phangorn to transform a matrices and data.frames into phyDat objects. For example you can read in your data with read.table() or read.csv(), but you might need to transpose your data. For matrices as.phyDat() assumes that the entries each row belongs to one individual (taxa), but for data.frame each column. For binary data you can transform these with a command like (depending how you coded them):
As you may have seen a version of ape and phangorn have been released. ape jumped to version 4.0 and you can see the changes here. Some of the nicest new features are that many useful functions for transforming phylo objects have been made generic. This includes functions like is.rooted, unroot, reorder is.binary, is.ultrametric or di2multi and these now work also on multiPhylo objects.
In practice this means that instead of typing
phangorn is a package for R. To use it, you first need to download and install R. RStudio provides a nice user interface for R.
You can install the latest release version from CRAN
install.packages("phangorn") or install the latest development version using the install_github function in the devtools package from github.
library(devtools) install_github("KlausVigo/phangorn") For devtools to work on windows you need addionally to have installed Rtools and on mac you need Xcode to compile some C code.