Friday 9 March 2012

How to write on the same line in R?

You can achieve this by using the old trick of the carriage return '\r' and the command cat()

for ( i in 1:100){
    cat(c('\r   ',i))
}

Will print on the same line each number from 1 to 100

Thursday 1 March 2012

How to substitute 'NA' in R for any other desired value


my.table$column[is.na(my.table$column)] <- 0