In mathematics, Newick tree format (or Newick notation or New Hampshire tree format) is a way of representing graph-theoretical trees with edge lengths using parentheses and commas. It was adopted by James Archie, William H. E. Day, Joseph Felsenstein, Wayne Maddison, Christopher Meacham, F. James Rohlf, and David Swofford, at two meetings in 1986, the second of which was at Newick's restaurant in Dover, New Hampshire, US. The adopted format is a generalization of the format developed by Meacham in 1984 for the first tree-drawing programs in Felsenstein's PHYLIP package. [Source: Wikipedia]
This package allows you to read and print the Newick format, as well to get information about the individual levels of the letters.
library(devtools)
devtools::install_github("SandraKla/NewickReader")
Pavlopoulos, Georgios & Soldatos, Theodoros & Barbosa-Silva, Adriano & Schneider, Reinhard. (2010). A reference guide for tree analysis and visualization. BioData mining. 10.1186/1756-0381-3-1.