Hi,
I'm trying to divide a taxonomy table, which has a few hundred rows and which looks something like this:
d:Bacteria(96.3),p:Firmicutes(70.8),c:Clostridia(69.2),o:Clostridiales(69.2),f:Lachnospiraceae(63.3),g:Roseburia(48.4)
I'm trying to make a new column for each name (e.g., "d", "p", "c" etc as column names), and have Bacteria, firmicutes, clostridia etc in their respective column, with the associated values in brackets retained,
I've tried using a variety of methods:
colsplit(taxa, split=",", names) (where names is a vector of the col names I want and taxa is the input data frame)
split <- strsplit(as.character(taxa, ",", fixed=TRUE)
and a variety of other split methods, but it keeps returning errors like "argument "split" is missing, with no default".
Any suggestions on how I might achieve this?
Thanks for any help!