nan_replace | R Documentation |
This function takes a dataframe and checks for NaN values. It also replaces the NaN values if requested, a with user-specified value. This function was partially taken from the following StackOverflow link: https://stackoverflow.com/questions/18142117/how-to-replace-nan-value-with-zero-in-a-huge-data-frame/18143097
nan_replace(df, replace = TRUE, value = 0)
df |
Dataframe to be checked for NaN values |
replace |
Whether to replace NaN values. |
value |
Value to replace NaN with. |
df <- data.frame(a = c(1, 2), b = c(NaN, 3)) nan_replace(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.