sammgolo
sammgolo

Reputation: 196

load .yml file in R

I am trying to use config.yml in R. But whenever I load the file using

my config file looks like this

default: 
   dataconnection: 
     driver: 'ODBC Driver 11 for SQL Server' 
     server: 'server' 
     uid: 'Username' 
     pwd: 'password' 
     port: 1433 
     database: 'Data_Science' 

rsconnect: 
  dataconnection: 
    driver: 'FreeTDS' 
    server: 'server' 
    uid: 'username' 
    pwd: 'password' 
    port: 1433 
    database: 'Data_Science'

Code:

config <- config::get(file = "C:/Users/Samuel.Golomeke/Documents/Data Science/Codes/R codes/SQL_Server_shiny_connect/config")

I keep getting the following warning message:

Warning message: In readLines(con) : incomplete final line found on 'C:\Users\Samuel.Golomeke\Documents\Data Science\Codes\R codes\SQL_Server_shiny_connect\config.yaml'"

why is that?

Upvotes: 7

Views: 2549

Answers (1)

Jay
Jay

Reputation: 751

Make sure the last line in the config.yaml file has a blank line with no whitespace (space, tab, etc).

Upvotes: 8

Related Questions