for example suppose we have this csv file's:
a.cav
data.frame(age = c(10:14),
heaight = c(150, 198, 115, 124, 132))
b.cav
data.frame(age = c(20:26),
heaight = c(152, 154, 180, 165,190, 183, 125))
c.cav
data.frame(age = c(30:33),
heaight = c(150, 175, 145, 132))
d.cav
data.frame(age = c(40:42),
heaight = c(150, 198, 132))
and we have this data frame:
d1 <- data.frame(name = c("a", "b", "c", "d"),
code = c("x", "y", "w", "z"))
now we want to get names from d1 dataframe and read csv files (a, b,c,d) and add value a and x in new columnt to a and value b and y to b cav file and etc. and the end merge all them.
exit:
age heaight name code
1 10 150 a x
2 11 198 a x
3 12 115 a x
4 13 124 a x
5 14 132 a x
7 20 152 b y
8 21 154 b y
9 22 180 b y
10 23 165 b y
11 24 190 b y
12 25 183 b y
13 26 125 b y
14 30 150 c w
15 31 175 c w
16 32 145 c w
17 33 132 c w
18 40 150 d z
19 41 198 d z
20 42 132 d z