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

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -