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

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -