How to replace inf values by NA in R