FT. Ye
FT. Ye

Reputation: 33

How to format file path into two or more lines in R?

I want my code to be more formated, I want following code:

Finaldata <- read_dta("F:/AuditGovernance/Audit firmGovernance/ProjectAA/1Data/GAuditFinal3Oct2016.dta")

to be formated as

Finaldata <- read_dta("F:/AuditGovernance/Audit firmGovernance/
                       ProjectAA/1Data/GAuditFinal3Oct2016.dta")

However R report this as error:

Error: This kind of input is not handled

so How can I write file path in two or more lines in R?

Upvotes: 1

Views: 1176

Answers (2)

pyll
pyll

Reputation: 1764

Not sure why you want to do this, but here ya go....

Finaldata <- read_dta(paste("F:/AuditGovernance/Audit firmGovernance/",
                       "ProjectAA/1Data/GAuditFinal3Oct2016.dta", sep = ""))

Upvotes: 0

Phil
Phil

Reputation: 4444

Use paste or paste0:

Finaldata <- read_dta(paste0(
  "F:/AuditGovernance/Audit firmGovernance/",
  "ProjectAA/1Data/GAuditFinal3Oct2016.dta"))

Upvotes: 2

Related Questions