It would seem that is.nan
doesn’t actually have a method for data frames, unlike is.na
. So, let’s fix that!
is.nan.data.frame <- function(x)
do.call(cbind, lapply(x, is.nan))
data123[is.nan(data123)] <- 0
More Related Contents:
- Replace values greater than zero with 1 in r
- How to replace NA values in a table for selected columns
- Replace NA in column with value in adjacent column
- Replace specific characters within strings
- Replace all particular values in a data frame
- Match values in data frame with values in another data frame and replace former with a corresponding pattern from the other data frame
- Remove all text before colon
- Replace given value in vector
- Replace values in a vector based on another vector
- in R, use gsub to remove all punctuation except period
- R: Replace multiple values in multiple columns of dataframes with NA
- Replacing occurrences of a number in multiple columns of data frame with another value in R
- Using get() with replacement functions
- Replace a value NA with the value from another column in R
- Replace all values in a matrix
- Replace in a factor column
- Replace empty values with value from other column in a dataframe
- replacing values in a column with another column R
- How to subset data as per account in R?
- R memory management / cannot allocate vector of size n Mb
- Finding running maximum by group
- How to increase font size in a plot in R?
- R: 4D plot, x, y, z, colours
- R ggplot2: stat_count() must not be used with a y aesthetic error in Bar graph
- Looping through t.tests for data frame subsets in r
- Filter data frame rows based on values in vector
- How do I map a vector of values to another vector with my own custom map in R [duplicate]
- Add percentage labels to a stacked barplot
- Convert a vector into a list, each element in the vector as an element in the list
- Identifying where value changes in R data.frame column