fix R import code generation
merged