I have a data frame that looks like this
df <- data.frame(col1=c("A","B","C","D"), col2=c(0,0,0,1))
df
col1 col2
1 A 0
2 B 0
3 C 0
4 D 1
I would like to replace each 0 in the col2 with 0.00000001 Is that possible to do it with the replace function in dplyr?
I want my data.frame to look like this
col1 col2
1 A 0.00000001
2 B 0.00000001
3 C 0.00000001
4 D 1