[R-sig-Geo] join csv tables
Lukasz Szybalski
szybalski at gmail.com
Thu Apr 10 15:44:59 CEST 2008
On Thu, Apr 10, 2008 at 7:16 AM, Alexandru Dumitrescu
<alexandru.dumitrescu at gmail.com> wrote:
> Hi everybody,
> Is there a way to join two csv tables
> in R using a common column having the same values?
>
FYI.
If you wanted to do it outside of R, before your read it in, you could
use this script:
http://lucasmanual.com/out/combine.py
#Program that combines multiple tsv files into one based on the column name
#Requirement: Same column names that exist on first row
#Action: Will combine all tsv that are in current directory, and
output all.tsv file
You can change line 20 to: reader= csv.reader(open(i))
to read csv instead of tsv.
Then do:
python combine.py (and this will merge all csv in folder into all.csv)
Lucas
More information about the R-sig-Geo
mailing list