Like this:
> df[df==""]<-NA
> df
A B
1 <NA> 12
2 xyz <NA>
3 jkl 100
More Related Contents:
- How to replace NA values in a table for selected columns
- Match values in data frame with values in another data frame and replace former with a corresponding pattern from the other data frame
- R: Replace multiple values in multiple columns of dataframes with NA
- Replace in a factor column
- Replace empty values with value from other column in a dataframe
- Quickly reading very large tables as dataframes
- Counting unique / distinct values by group in a data frame
- cbind a dataframe with an empty dataframe – cbind.fill?
- Split a large dataframe into a list of data frames based on common value in column
- Splitting a dataframe string column into multiple different columns [duplicate]
- Convert data.frame column format from character to factor
- How to convert a table to a data frame
- How do I combine two data-frames based on two columns? [duplicate]
- R Apply() function on specific dataframe columns
- Count NAs per row in dataframe [duplicate]
- Changing Column Names in a List of Data Frames in R
- Subset of rows containing NA (missing) values in a chosen column of a data frame
- rbind dataframes with a different column name
- Converting two columns of a data frame to a named vector
- Collapsing data frame by selecting one row per group
- Creating a new variable from a lookup table
- Practical limits of R data frame
- rbind data frames based on a common pattern in data frame name
- How I can select rows from a dataframe that do not match?
- Join two data frames in R based on closest timestamp
- How to append a whole dataframe to a CSV in R
- Convert a data frame to a data.table without copy
- Shifting a column down by one
- Identifying where value changes in R data.frame column
- What is the first column in R’s mtcars dataset?