Read table using variable in the directory

55 Views Asked by At

I'm looking to read in a table.txt from a specific directory. I'd like to assign parts of that directory to a variable.

Without the variable:

asv.table <- read.table("/home/jbuser/Uganda/asv.Uganda.txt", sep="\t",row.names = TRUE, header=TRUE)

With the variable:

Region = "Uganda"
asv.table <- read.table(paste("/home/jbuser/",Region,"/asv.",Region,".txt", sep=""),row.names = TRUE, header=TRUE)

But my code just stalls out and returns nothing even after several minutes. Thank you in advance.

0

There are 0 best solutions below