[R] How to globally convert NaN to NA in dataframe?
m@rong|u@|u|g| @end|ng |rom gm@||@com
Thu Sep 2 15:18:13 CEST 2021
I have some NaN values in some elements of a dataframe that I would
like to convert to NA.
The command `df1$col[is.nan(df1$col)]<-NA` allows to work column-wise.
Is there an alternative for the global modification at once of all
I have seen from
that once could use:
is.nan.data.frame <- function(x)
do.call(cbind, lapply(x, is.nan))
data123[is.nan(data123)] <- 0
replacing o with NA, but I got
> logi NA
when modifying my dataframe df.
What would be the correct syntax?
More information about the R-help