Learn R Programming

vvauditor (version 0.7.0)

remove_duplicates_and_na: Remove Duplicates and NA Values from Input

Description

This function removes duplicate values and NA values from the input. It first removes NA values from the input using the na.omit function from the stats package. Then it removes duplicate values from the result using the unique function.

Usage

remove_duplicates_and_na(input)

Value

A vector or data frame with duplicate values and NA values removed.

Arguments

input

A vector or data frame.

Examples

Run this code
# Create a vector with duplicate values and NA values
input <- c(1, 2, NA, 2, NA, 3, 4, 4, NA, 5)
# Remove duplicate values and NA values
output <- remove_duplicates_and_na(input)
print(output)

Run the code above in your browser using DataLab