Sorts the df_abundance dataframe by the given column argument.
Arguments
- df_abundance
The data frame to use. A string that contains a path can be used to load files.
- column
Can be either a string containing the name of the column or an int that is its index
- rank_threshold
Optional. Integer. Discards rows if their column value is equal to or lower than it. Defaults to 0.
- is_phyloseq
Logical, optional. Use if the object to be analysed has the phyloseq class.
- ...
passes arguments to
read.table.
Value
The input data frame with a column appended to the left that stores the generated ranking. The column used for ranking is renamed "abundance".
Examples
rankedWeblinks <- BC_rank(df_abundance=DGBD::Weblinks, column=2, rank_threshold=4)
head(rankedWeblinks)
#> BC_rank degree abundance
#> 1 3 0 35159835
#> 2 1 1 106649769
#> 3 2 2 40711748
#> 4 4 3 22648832
#> 5 5 4 12617832
#> 6 6 5 8188854
rankedTara <- BC_rank(Tara_Data,3,is_phyloseq=TRUE)
head(rankedTara)
#> BC_rank MGYA00133816 MGYA00133817 abundance
#> 941278 195 7 11 8
#> 769551 138 1 15 14
#> 4165717 620 1 0 1
#> 1111505 179 1 17 9
#> 1111241 80 7 5 28
#> 576629 43 1 33 52