I have a data frame (Log.df) that after I took the log of the values has returned many -Inf data points. Here is an example:
[one] [two] [three] [A] 2.3 -Inf -Inf [B] -Inf 1.1 2.4
I want to replace all the -Inf with 0. I tried this code:
Log.df <- Log.df[Log.df == "-Inf"] <- 0
And this code:
Log.df <- Log.df[Log.df == -Inf] <- 0
Both returned a single value of 0 and wiped the whole set!