Hi how can I assign value to the 1st column characters that is based on the 2nd column. See my sample dataframe below.
> Code <- c('A','B','C','D','E')
> Value <- c(1.23,1.4,1.55,1.67,1.3)
> ds <- data.frame(Code, Value)
> ds
Code Value
1 A 1.23
2 B 1.40
3 C 1.55
4 D 1.67
5 E 1.30
Now for example when I type "A" in the R console it should have a value of 1.23. Not error as shown below.
> A
Error: object 'A' not found
Desired output is.
> A
[1] 1.23
It should also work in Codes B to E.