I have a data.frame
DF1
a.x.c b.y.l c.z.n d.a.pl f.e.cl
which consists of numeric columns
I also have a list
DF2
a.x.c c.z.n f.e.cl
which contains certain names of columns in DF2
I need to create DF3
that would store only those columns of DF1
which have matching names in DF2
.
I have tried which
to find indexes of columns i need. But problem that i have long name list of columns and which
become useless.
Could you please help. Thank you beforehand.
str(DF1)
andstr(DF2)
– akrun