我对R一无所知,但想知道替换一个可用于替换R代码的以下(片段)中的/home/subdirectory/DataFiles/
的变量:
x1 <- subset(read.csv("/home/subdirectory/DataFiles/Isic_bilateral_trade1.csv"),
year>=1990)
答案 0 :(得分:2)
将目录设置为变量并使用file.path方法:
dataDir <- "/home/subdirectory/DataFiles"
x1 <- subset(read.csv(file.path(dataDir, "Isic_bilateral_trade1.csv")),year>=1990)
等