Use suppressWarnings()
:
suppressWarnings(as.numeric(c("1", "2", "X")))
[1] 1 2 NA
This suppresses warnings.
More Related Contents:
- How to convert a factor to integer\numeric without loss of information?
- How do I replace NA values with zeros in an R dataframe?
- What specifically are the dangers of eval(parse(…))?
- Replacing character values with NA in a data frame
- How to replace NA with mean by group / subset?
- suppress NAs in paste()
- Replace NA in column with value in adjacent column
- How to delete rows from a dataframe that contain n*NA
- Coalesce two string columns with alternating missing values to one
- How to omit NA values while pasting numerous column values together?
- Omit rows containing specific column of NA
- Count non-NA values by group [duplicate]
- Why would R use the “L” suffix to denote an integer?
- aggregate methods treat missing values (NA) differently
- Combine column to remove NA’s
- How to subset data in R without losing NA rows?
- How to delete columns that contain ONLY NAs?
- Randomly insert NAs into dataframe proportionaly
- Dealing with TRUE, FALSE, NA and NaN
- replace NA value with the group value
- Replace a value NA with the value from another column in R
- Add a column with count of NAs and Mean
- Counting non NAs in a data frame; getting answer as a vector
- Replace all NA with FALSE in selected columns in R
- Creating (and Accessing) a Sparse Matrix with NA default entries
- R: eval(parse(…)) is often suboptimal
- Find names of columns which contain missing values
- Find columns with all missing values
- How to replace empty string with NA in R dataframe?
- How can I count the number of NAs per group?