Hi FJCC,
Thanks for the suggestion. It works.
For return one object in the R function, the following code works. Does that mean the r return() code is not required in a function. As long as we save the output when we call the function?
useDataFrame <- function(tab1,tab2){
d6 <- read.table(paste0("/Users/limin/Desktop/cnr_cns/", tab1) , header = T)
}
DF <- useDataFrame("AJ-06_T.deduplicated.realign.cnr")
f <- DF
The following code not working:
useDataFrame <- function(tab1,tab2){
d6 <- read.table(paste0("/Users/limin/Desktop/cnr_cns/", tab1) , header = T)
return(d6)
}
useDataFrame("AJ-06_T.deduplicated.realign.cnr")
f <- d6

Therefore, my understanding is: no matter how many objects we want an R function to return, first we need to save the output of calling a function. And r return() is not required.
Is my understanding correct?
Best,
LC