Writing input to R to file #w2