I have the following code executing in my server function:
``
# Integral of xf(x)
Sxfx <- 0
for(i in 1:501)
{
sumxfx <- 0
for(j in 1:i)
{
sumxfx <- sumxfx + xfx[j]
}
Sxfx[i] <- sumxfx
}
``
When I execute it, I get the following error message:
Warning: Error in if: missing value where TRUE/FALSE needed [No stack trace available]
Any tips on how to fix this? The vector it relates to lengthwise is c(0:500).
I previously got an error about the differing number of rows, when my loop was going 1:500. With that error, my file wouldn't execute at all. So I changed it to the current loop going 1:501, and the error message changed to this.
Any help will be greatly appreciated!