Hello,
I've an issue for create an function for the package
myfunction<-function(tab, a, b, c,format){
if(format ="M") {
...
} # Here I don't use the variable a,b,c
if(format ="L") {
...
} #Here I use the variable a,b,c
As you can see I use the variable a,b,c only when format ="L" so whenformat ="M"
there is a problem because the variable a,b,c are a declaration of the column of the list.
information : M = data is matrix format ; L = data is list format
I would like to know how I can use the variable a,b,c only for format = "L"
I don't know if I can put the condition in declaration of variable in function for e.g
myfunction<-function(tab, if (format = "L") a, b, c else format = "M"){
...}
I tried but is not OK !
Have an idea
Thanks in advance