I tried to create a sum function that ignores NA values for practicing. My code is:
my.sum <- function(x){
sum.f = 0
y <- !is.na(x)
z <- x[y]
n <- length(z)
for (i in 1 : n) {
sum.f <- sum.f + z[i]
}
return(sum.f)
}
When I run the code directly in R Console, I see the code as expected:
> > my.sum <- function(x){
> + sum.f = 0
> + y <- !is.na(x)
> + z <- x[y]
> + n <- length(z)
> + for (i in 1 : n) {
> + sum.f <- sum.f + z[i]
> + }
> + return(sum.f)
> + }
But when I run the code in Tinn-R, I see this instead:
my.sum <- function(x){
> + sum.f = 0
> + y <- !is.na(x)
> + z <- x[y]
> + n <- length(z)
> + for (i in 1 : n) {
> + sum.f <- sum.f + z[i]
> + .... [TRUNCATED]
What is the meaning of [TRUNCATED]
in the Tinn-R console and why did I get it?