I have a table in a file with many rows which I have read into R using
data <-read.table("path/to/data.txt",header=TRUE, sep="\t",row.names=1)
A1 A2 A3 B1 B2 B3
Row1 1 3 2 3 2 6
Row2 3 2 1 3 6 7
...
I have then read this into a frame using
df <-data.frame(data)
I would like to perform a function() to compare the A samples against the B samples for each row,
function(A,B)
but I am unsure how to specify only the A’s and only the B’s from the data frame for each row – is there a way to do this all at once for the whole data table? Do I have to read the data into a frame or can I work straight from the initial read.table data?
Try this:
The result looks like this:
I only showed the first 3 results, the complete list length is 10 since
DFhas 10 rows.