This statement should change the value of allmonths$DIVauth
to either 1
or o
based on a comparison of the values of $cfs
and $Tess
. Instead, it returns the following error and puts the value 1
in every row:
The condition has length > 1 and only the first element will be used.
My statement:
if (allmonths$cfs >= allmonths$Tess) {
allmonths$DIVauth <- 1
} else {
allmonths$DIVauth <- 0
}