I have read a .csv file which has 785 rows and 24217 columns. 
my_data <- read.csv("test.csv", header = FALSE)
I want to segregate the columns where the value in 785 row is 6. So I tried the following:
my_data[my_data[1:24217][785,] == 6]
the result of which is mixed up columns, like in a list. How could I get the resulting structure which would still resemble the structure in csv/my_data. All I want is to subset my_data where the value in 785th row for each column is 6.
Sample set:
      V1       V2       V3       V4    .   .   .     .    . N th Column
1   0.000000 0.000000 0.000000
2   0.000000 0.000000 0.000000
3   0.000000 0.000000 0.000000
4   0.000000 0.000000 0.000000
5   0.000000 0.000000 0.000000
6   0.000000 0.000000 0.000000
7   0.000000 0.000000 0.000000
8   0.000000 0.000000 0.000000
9   0.000000 0.000000 0.000000
10  0.000000 0.000000 0.000000
.
.
.
785  0.000000 6.000000 5.50000
As you could see in the above set that are 785 rows and N columns which in my case go upto 24217. I want to subset data based upon the value in 785th row. So, I want to separate columns where last value is 6 (in the 785 row).
 
    