Hi, Prateek-
OK, glad you figured those things out.
I guess I didn't catch that you were using a readafni function in R specifically. Even later on in the thread, it seemed like you were just running regular command line functions through an R script.
In the future, it would probably help solve issues more quickly if you mention that kind of execution method (esp. non-command line usage, and using other I/O programs that are outside the software). We would probably rather have "too many" details, than too few.
thanks,
pt