Question:
I have a dataset of ids, months and some metric x.id == "a1"
, the 2nd month’s x is NA. (error: Input x_growth_start
can’t be recycled to size 3.)integer(0)
. Can I make the code run (say, by letting it return NA
if integer(0))
? I tried what was suggested here but it didn’t work Input `typ` can’t be recycled to size in RThanks in advance.
Answer:
You should usematch()
. It returns NA
when no match is found.If you have better answer, please add a comment about this, thank you!