I'd appreciate some assistance in what R code to use in the following situation:
This is the top 11 rows of the dataset:
Sa1_main11 Sa1_main11_2
20401106101 20401106101 -
20401106101 21105128609 -
20401106101 21105128653
20601110501 20601110501
20601110501 20601110530
20601110501 20601110531
20601110501 20601110532
20601110501 20601110533
20601110501 20601110534
20601110501 20601110614
20601110502 20601110502
SA1s are a geographical unit used by the Australian Bureau of Statistics.
This file is a list of what SA1 are contiguous - column 1 is the base SA1, and the second column is the SA1 that adjoins the first SA1.
For example, take the first 3 rows
- 20401106101 adjoins itself
- 21105128609 adjoins 20401106101
- 21105128653 adjoins 20401106101
What I need to do is to produce a dataset where the first line is of the format
20401106101 21105128609 21105128653
I've tried reshape2
package, but the lack of row labels (which would all be identical) makes that not possible for me.
Edit - here is a link to what the data looks like
https://www.dropbox.com/s/tigqdevybskm1bs/Original.JPG
here is a link to what the top 3 rows should look like