remove_NA | R Documentation |
This function allows you to remove the NAs found in a list you are working with and save it to a new list.
remove_NA()
> x = c(1,2,3,NA,4,5,NA)
> new_x = remove_NA()
Remember! remove_NA() needs to know what you want the new list name to be!
Make sure you typed *your new list name here* = remove_NA(). If not, press Esc to cancel.
What is the name of the list with your data? x
Removed 2 NAs!xx
You can do this yourself by typing:
*new list name* = x[!is.na(x)]
> new_x
[1] 1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.