I am new to programming in R and Python, however have some basics. I have a technical question about computation. I would like to know if there are any functions for performing subtraction of all features(rows) to a particular value (row) from the same data list. I would like to obtain the outputvalue1 as shown below and post this, multiply by (-1) to obtain the outputvalue2.
Please let me know if you need more details.
I have tried performing the same operation in the MS Excel, this is very tedious and time consuming.
I have many large datasets with several hundred rows and columns which becomes more complex to manually perform the same in MS Excel. Hence, I would prefer to write a code and obtain the desired outputs.
|Feature| |Value| |Output_value1| |Output_value2|
|Gene_1| |14.25633934| |0.80100922| |-0.80100922|
|Gene_2| |16.88394578| |3.42861566| |-3.42861566|
|Gene_3| |16.01| |2.55466988| |-2.55466988|
|Gene_4| |13.82329514| |0.36796502| |-0.36796502|
|Gene_5| |12.96382949| |-0.49150063| |0.49150063|
|Normalizer| |13.45533012| |0| |0|
Thank you. But if I have hundreds of values/sample columns arranged in the data file , for instance as given below:
How could this be done to obtain the output in the single table? df1$Outputvalue1, df1$Outputvalue2, df1$Outputvalue3, df1$Outputvalue4, ........df1$Output_valueN
Here, df1$Output_value = difference between (Feature [1 to 5] - Feature [Normalizer])
Basically, Initially I would like to obtain the df1$Outputvalue from 1,.....N table and then multiply by (-1) in the next step i.e df$Outputvalue2.
Well, as I understand you have many columns that you want to multiply in -1 and write result as new column.
So, here you can do it for every column and add the result as new column.
df[,2:6] is index of your columns.
Thank you shahryary.