View source: R/BCG.ContLevel.R
BCG.ContLevelText | R Documentation |
Convert Biological Condition Gradient (BCG) continuous value to level text.
BCG.ContLevelText(ContValue)
ContValue |
Vector of continuous BCG levels (0 to 6). |
Internal function to get narrative BCG level based on the continuous level.
'status' is the BCG Level as a number (x/y tie is x.5, the rest are integers).
'status_pm' is the BCG Level with +/- descriptors.
Returns a dataframe of BCG levels ('status' and 'status_pm') along with input values ('value').
# construct a dummy dataset
L1 <- c(rep(0, 12))
L2 <- c(0.4, 0, 0.4, rep(0,7), 0, 0)
L3 <- c(0.6, 0, 0.6, 0, 0.42, 0, 1, 1, 0.22, 0.33, 0.5, 0)
L4 <- c(0, 0.9, 0, 0, 0.58, 0.05, 0, 0, 0.78, 0.67, 0.5, 0)
L5 <- c(0, 0.1, 0, 1, 0, 0.95, rep(0,4), 0, 1)
L6 <- c(rep(0, length(L1)))
SAMPLEID <- LETTERS[1:length(L1)]
df_lev_memb <- data.frame(SAMPLEID = SAMPLEID
, L1 = L1
, L2 = L2
, L3 = L3
, L4 = L4
, L5 = L5
, L6 = L6)
# Calculate BCG Level Assignments
df_Levels <- BCG.Level.Assignment(df_lev_memb)
# Run Function
BCG_Status <- BCG.ContLevelText(df_Levels[, "Continuous_BCG_Level"])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.