On Feb 14, 2012, at 10:59 AM, Marion Wenty wrote:
Thank you very much for your help, David!
Now I have got an object which I can work with.
You mentioned that I took two steps to create the new column names.
I had tried doing it in one step but couldn't find out how. Could
you help me with that, as well?
Thank you very much!
Marion
2012/2/14 David Winsemius <[email protected]>
On Feb 14, 2012, at 9:20 AM, Marion Wenty wrote:
Dear R-helpers,
I created an own function which looks like this
s_elternmz <- function(Var="balt")
{
Dg_a<-mz[,c("asbhh","apkz",Var)]
colnames(Dg_a)[colnames(Dg_a)=="apkz"]<-"bpkzm"
colnames(Dg_a)[colnames(Dg_a)==Var]<-paste(Var,"_m",sep="")
The above line seemed to be the first change to make <Var>_m
mz_int<-merge(mz,Dg_a,by=c("asbhh","bpkzm"),all.x=T)
colnames(Dg_a)[colnames(Dg_a)=="bpkzm"]<-"bpkzv"
colnames(Dg_a)[colnames(Dg_a)==paste(Var,"_m",sep="")]<-
paste(Var,"_v",sep="")
Then this line changed <Var>_m to become <Var>_v. Why not change it to
<Var>_v in the first place?
Why take two steps to change that column name?
David Winsemius, MD
West Hartford, CT
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.