# Pulls out unique WORDS in leaf margin column. You may need to alter the 
# file name or column of interest.

raw <- read.csv(file="Merged.csv", as.is = TRUE)
strsplit(paste(raw$LeafMargin), split=" ") -> temp 
unlist(temp) -> temp2
unique(temp2)

# The following produces a list of unique phrases in the growth_form column, 
# along with the number of times that phrase occurs. 

table(raw$growth_form) 
phrases_growth <- table(raw$growth_form)
write.csv(phrases_growth, file= "phrases_growth", append = FALSE, quote = FALSE)
