Dear R-experts,
I have a dataset “df” with a character variable “inst” (shown below as an excerpt from "df", in the form of just one column).
I also have two vectors under the "Values" section in my Rstudio named “object1” and “object2”, each containing 10 different numeric values. Let say, “object1” contains values from 91 to 100, and "“object2” has values from 101 to 110 (in reality those values are different, but it is only an example). I want to create a new column in “df”, in which values from “object1” will correspond to the first 10 rows of "West", and then get applied again to the next 10 rows of "West". Values from “object2” have to correspond to “Atlantic constrained” in “inst”. So the final output has to look like this:
Could you guys suggest the code to do it just in one go?