Description Usage Arguments Value Examples
View source: R/calc_treated_data.R
'calc_treated_data()' construct a new data frame which construction is like raw_data that has multiple columns as labels and the renaming columns are detection values of each drug on each sample.
1 2 3 4 5 6 7 8 | calc_treated_data(
raw_data,
mrl_data,
st_drug,
ed_drug,
raw_col_en2cn = RawColnameTrans,
product_name = ProductLabelName
)
|
raw_data |
a data frame. It is raw detection data of each sample on each drug. It has multiple columns as labels of each sample and the remaining columns are raw detection values. |
mrl_data |
a data frame. It has one column named "\u4ea7\u54c1\u540d\u79f0" and the other columns named with name of drugs. Every row is MRL value of one product on each drugs. |
st_drug |
a character. Name of the first column of drug. |
ed_drug |
a character. Name of the last column of drug. |
raw_col_en2cn |
list, default |
product_name |
character. It is the product dimension name. |
a data frame with 3 extra columns compared with 'raw_data'.
1 2 3 4 5 6 | # library(antgreens)
# set_dimensions("name", list(t1="t1", t2="t2"))
# df <- data.frame(name = c('a', 'b', 'a', 'c', 'c'),t1 = c(1,2,3,4,5),t2 = c(0,9,8,7,6))
# mrl <- data.frame(name = c('a','b','c'),t1 = c(2,2,4),t2 = c(4,10,6))
# mrl_map <- mapping_mrl(as.matrix(mrl[,2:3]), mrl$product)
# nvm <- calc_treated_data(as.matrix(df[,2:3]), mrl_map, "t1", "t2")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.