How can I extract the decimal part of the number? Say I have a decimal number, my_num <- 3.55.
How can I extract the decimal part of the number? Say I have a decimal number, my_num <- 3.55.
There are multiple ways to solve and extract the decimal part some are: lets store the result in dec
dec <- my_num - floor(my_num)dec <- my_num%%1dec <- my_num - as.integer(my_num)dec <- my_num - trunc(my_num)all these will result the same.