R interface to fast C functions for writing large vectors