Description Usage Arguments Value Examples
Helps track down which values are introducing NA's in the as.numeric function. Can be run on a vector or on a dataframe. In the later case it can only check one variable at a time, and will return all columns for the rows that have the na coercion warning. I find this dataframe view helpful in diagnosing the problem.
When to use it? After seeing, "Warning message: NAs introduced by coercion" Run this function on your data and variable to find out exactly which rows are causing the issue. This is a warning that should not be ignored. Nothing is worse than discovering that all the rows greater than 999 had commas (1,000) and are now NA after doing a bunch of analysis.
1 |
x |
a vector or a variable name in quotes |
df |
optional, a data frame |
a data frame with all rows containing non valid numeric values
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.