Dear all,

The following function code fails with errors (see below):

RegPlots <- function (data, ContrVar, RespVar){
      intNmbrRows<-length(RespVar);intNmbrCols<-lenght(ContrVar)
      par(mfrow=c(intNmbrRows,intNmbrCols))
      For(i in 1:intNmbrRows){
          For (j in 1:intNmbrCols){
              RegGraf(data,ContrVar[i],RespVar[j])
          }
      }
      par(mfrow=c(1,1))

#(RegGraf is another function that creates a plot and that runs flawlessly)

Output (translated to english):

RegPlots <- function (data, ContrVar, RespVar){
+     intNmbrRows<-length(RespVar);intNmbrCols<-lenght(ContrVar)
+     par(mfrow=c(intNmbrRows,intNmbrCols))
+     For(i in 1:intNmbrRows){
Error: Unexpected 'in' in:
"    par(mfrow=c(intNmbrRows,intNmbrCols))
      For(i in"
        For (j in 1:intNmbrCols){
Error: Unexpected 'in' in "        For (j in"
            RegGraf(data,ContrVar[i],RespVar[j])
Error in RegGraf(data, ContrVar[i], RespVar[j]) :
    Object 'ContrVar' not found
        }
Error: Unexpected '}' in "        }"
    }
Error: Unexpected '}' in "    }"
    par(mfrow=c(1,1))

Can someone please show me what is wrong?

Thanks in advance
Holger

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to