library(ape)
data(woodmouse)
#Just the third codon (assuming alignment is in-frame)
woodmouse[, seq(1, ncol(woodmouse), by=3) ]
## 15 DNA sequences in binary format stored in a matrix.
##
## All sequences of same length: 322
##
## Labels: No305 No304 No306 No0906S No0908S No0909S ...
##
## Base composition:
## a c g t
## 0.285 0.238 0.219 0.258
#skipping the thrid codon
woodmouse[, -seq(1, ncol(woodmouse), by=3) ]
## 15 DNA sequences in binary format stored in a matrix.
##
## All sequences of same length: 643
##
## Labels: No305 No304 No306 No0906S No0908S No0909S ...
##
## Base composition:
## a c g t
## 0.318 0.273 0.079 0.330