代码之家  ›  专栏  ›  技术社区  ›  pedro

如何将表格移到文件名中?

r
  •  0
  • pedro  · 技术社区  · 7 年前

    我有:

    paste("~/coefficient_rho",Sys.Date(), sep="_","/correlation.RData")
    

    [1] "~/coefficient_rho_2019-04-30_/correlation.RData" 
    

    我想要的是

    [1] "~/coefficient_rho_2019-04-30/correlation.RData"
    

    有什么建议吗?

    1 回复  |  直到 7 年前
        1
  •  2
  •   symbolrush    7 年前

    你可以结合使用 paste / paste0 为了得到你想要的:

    paste0(paste("~/coefficient_rho",Sys.Date(), sep="_"),"/correlation.RData")
    [1] "~/coefficient_rho_2019-04-30/correlation.RData"
    
        2
  •  3
  •   Haezer    7 年前

    你可以把第一个表格写在字符串中 "~/coefficient_rho_" 使用 paste0

    paste0("~/coefficient_rho_", Sys.Date(), "/correlation.RData")