I am an beginner in R and don`t find a solution for the following problem. Any help would be really appreciated!
I have a data.frame and want to replace certain valu
You can use match:
match
dataframe <- transform(dataframe, Year = year[match(date, yearend)]) date variable value Year 1 19921231 a 1 1992 2 19931231 a 2 1993 3 19941231 a 3 1994 4 19941231 b 4 1994 5 19931231 b 5 1993 6 19941231 b 6 1994