modified for R commands