I have a table (no header) in R:
1 1 1 0 0
1 1 1 0 0
0 0 0 1 1
What I want to do is extract continuous 1s from every row and column to later on make a string with these 1s and finally convert the string to an integer from binary.
Example, say I extract the continuous 1s from row 1 -> 1 1 1, then I make a string from these 1s, and finally convert this string which is a binary value to a n integer, the outcome should be 7.
Thank you.