I suggest you go back to your code that was supposed to make d1, because that is what hasn't worked.
Here you can read about reprex in general. but it seems you need to take more time to identify your first point of failure. always tackle errors from the top down and not from the bottom up. goodluck !