简体   繁体   English

在 R 中隐藏 package 开发中的凭据

[英]Hide credentials in package development in R

I'm developing a package for my company, and I want to need to hide the credentials of the connections to redshift databases.我正在为我的公司开发 package,我想隐藏与 redshift 数据库的连接凭据。 Is there an easy way to set it up?有没有简单的方法来设置它?

Try this:尝试这个:

  1. Create a file my_credentials.env创建一个文件my_credentials.env
  2. At the beginning of the code run readRenviron("my_credentials.env")在代码的开头运行readRenviron("my_credentials.env")
  3. Access your variables by Sys.getenv("MY_VARIABLE")通过Sys.getenv("MY_VARIABLE")访问您的变量

More information over here basic or advanced更多信息在这里基本高级

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM