如何将文件路径格式化为R中的两行或更多行?

时间:2017-10-02 15:35:50

标签: r format rstudio

我希望我的代码更易于编码,我想要下面的代码:

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

将被格式化为

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

然而,R将此报告为错误:

Error: This kind of input is not handled

那么如何在R?

中的两行或多行中写入文件路径

2 个答案:

答案 0 :(得分:1)

使用pastepaste0

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

答案 1 :(得分:0)

不确定你为什么要这样做,但在这里你去....

Dim conn As New ADODB.Connection
Dim record As New ADODB.Recordset
Dim sSQL As String

Set conn = CurrentProject.Connection
Set record = New ADODB.Recordset
sSQL = "SELECT * FROM IC4_MMI_410 WHERE file = "
sSQL = sSQL & "'" & sFile & "'"
sSQL = sSQL & " And ccu_code = " & iCode

record.Open sSQL, conn, adOpenKeyset, adLockOptimistic