R stuff and use env vars