r - How to put input of a function in the name of text file? -
myf<- function(col,row){ x=5*col+row write.table(x,"res_row_col.txt")} myf(5,6) i expected file be:
res_5_6.txt but file written as:
res_row_col.txt
use paste0 function:
myf<- function(col,row){ x=5*col+row write.table(x,paste0("res_", row, "_", col, ".txt"))} myf(5,6)
Comments
Post a Comment