I suspect that your problem lies here:
getwd() doesn’t take any parameters, hence the “unused parameter” error. Since you’re just supplying an absolute file path here, all you need is:
file.path("D:/Rainfall", "CHIRPS data")
Note that I can’t verify that this is the only problem, since there’s no reproducible example to work with. If you try this and turn up another error, I think your best bet is to take @mara’s very good advice
.