Hi,

 

I have a set of dataframes names AINDSLIM, BINDSLIM, CINDSLIM ... NINDSLIM

In each dataframe I want to extract two variables, “pid” and “{w}region”,
where {w} means “a”, “b”, “c”, ...”n”

 

At the moment my code looks like:

 

> PidRegion <- data.frame(pid=XWAVEID$pid)

> this.region <- AINDSLIM[,c("pid", "aregion")]

> PidRegion <- merge(PidRegion, this.region, by="pid", all=T)

> this.region <- BINDSLIM[,c("pid", "bregion")]

> PidRegion <- merge(PidRegion, this.region, by="pid", all=T)

> this.region <- CINDSLIM[,c("pid", "cregion")]

...

> this.region <- NINDSLIM[,c("pid", "nregion")]

> PidRegion <- merge(PidRegion, this.region, by="pid", all=T)

 

But surely there’s a way to automate this? 

 

Any suggestions?

 

Jon Minton

 

 



Checked by AVG Free Edition. 

22/04/2007
20:18
 

	[[alternative HTML version deleted]]

