Normalises the percentages

normalise(df, col2convert = 2:ncol(df))

Arguments

df

The dataframe containing the data to convert.

col2convert

A vector of the columns to convert. Default is all the columns but the first, which contains an age, a depth or a sampleID.

Value

A vector of unique taxonIDs.

Examples

df <- data.frame(matrix(1:25, ncol = 5))
colnames(df) <- paste(rep("col", 5), 1:5, sep = "")
normalise(df)
#>   col1      col2      col3      col4      col5
#> 1    1 0.8679826 0.9730902 1.0193806 1.0454305
#> 2    2 0.9428087 0.9883424 1.0083959 1.0196810
#> 3    3 1.0079798 1.0016266 0.9988285 0.9972540
#> 4    4 1.0652514 1.0133005 0.9904209 0.9775454
#> 5    5 1.1159776 1.0236403 0.9829741 0.9600892
normalise(df, col2convert = 3:5)
#>   col1 col2      col3 col4      col5
#> 1    1    6 0.9542126    1 1.0257828
#> 2    2    7 0.9797263    1 1.0114161
#> 3    3    8 1.0024052    1 0.9986457
#> 4    4    9 1.0226968    1 0.9872195
#> 5    5   10 1.0409592    1 0.9769360