replace several R commands