R and YAML script