I am very new to working in r, and i hope to get some help with writing code.
Below is the summary data frame, BARCODE is the name each sample treatment, in each sample treatment, there are datasets for either 'pos' or 'neg', which stands for positive and negative controls.
How do i write some code to calculate CV% for variables in EXPERIMENT_TYPE in each BARCODE? CV% can be calculated by the formula below, mean_pos/sd_pos*100%
BARCODE EXPERIMENT_TYPE MEAN SD
1 ACC_MCF10A neg 1882.700 421.39194
2 ACC_MCF10A pos 158.500 60.80328
3 ACC_Rad21 neg 2219.714 1069.38612
4 ACC_Rad21 pos 134.950 81.46131
What i want in the data output is something like this
BARCODE CV%_pos CV%_neg
1 ACC_MCF10A
2 ACC_Rad21
Thank you! Any helps would be appreciated!!!!