Description Usage Arguments Value Author(s) Examples
This function output consumes a data frame and split one by defined separator.
1 |
df |
a data frame. |
col |
name of a column in df. |
sep |
the separator to split the column. It can be regular expression. |
max |
optional. The number of columns to be split to. |
names |
optional. The names for the new columns. |
drop |
logical. Whether or not to keep the original column to be split in the output. |
The value returned by this function is a data frame. The
selected column is split each separator and appended to the
original data frame. The original column may may not to be kept
in the output as defined by option drop
.
The number of columns to be split to depends on three factors,
1) the maximum columns that the original column can be split to
by each separator; 2) the user definde max
; and 3) the
length of the column names defined by names
. This
function will split the column to the maximun number of the 3,
empty columns will be filled with empty strings.
Wen Chen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(ITS1)
# filter.OTU() returns a list
otu <- filter.OTU(list(ITS1=ITS1), percent=0.001)[[1]]
# split and keep taxonomy column
otu.split <- col.splitup(otu, col="taxonomy", sep="; ",
drop=FALSE)
## Not run:
# give new column names
tax.classes <- c("kingdom", "phylum", "class",
"order", "family", "genus")
otu.split <- col.splitup(otu, col="taxonomy", sep="; ",
drop=TRUE, names=tax.classes)
## End(Not run)
|
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-4
Loading required package: ggplot2
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
[1] "128 otus in ITS1 met the filter requirment."
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.