Displaying 1 result from an estimated 1 matches for "add0111".
Did you mean:
a00111
2012 Jun 12
3
Mapping one vector to another
...ing:
map <- read.table("../node_islands.csv", header=TRUE, sep=",")
map <- setNames(map$island, map$node)
periods$Island = map[periods$Bus]
Where after the first line, but before the second and third:
> map[1:3,]
node island
1 ABY0111 SI
2 ABY1101 SI
3 ADD0111 SI
and:
> periods[1:3, c("Date", "Period", "Bus", "Price")]
Date Period Bus Price
1 2004-01-01 1 ABY0111 31.20
2 2004-01-01 1 ADD0111 32.43
3 2004-01-01 1 ADD0661 32.38
This seems to work (it fooled me for quite a while :-...