Connect with us

Hi, what are you looking for?

Programming

Subsetting In R Programming (2)

In this tutorial, we going to look at Subsetting in R, but this tutorial is part 2 so if you didn’t read part 1, you can read it here.

Subsetting – Remove Missing Values

We learned missing values in the data types tutorial. We can remove missing values, for this, we going to use subsetting.

We created, simple a vector after that, we used is.na() function for finding missing value, we extract missing value with “!”. So you can use the exclamation mark to subtract any value, set, number, or array you want.

Subsetting – Remove Missing Values (Multiple)

We will learn a new function to clear 2 series at once. When working with multiple data sets, you can clear 2 data sets from null values ​​with this function. But, these 2 data sets require data of the same length.

We deleted the empty values ​​in the given two vectors with the complete.cases function.

Subsetting Remove Missing Value – Practice

Now we will do exercises to reinforce the concepts we have learned. Let’s pass the practice.

Subsetting Partial Matching

It is possible to access an index with shortcuts. For example, we want to call the variable in a list, instead of typing the entire name, we can write the initial letter or first 3 letters.

We can also use square brackets instead of the $ symbol. When using square brackets, the “exact” argument should also be used so that partial matching can be made.

CONGRATULATIONS, YOU FINISHED SUBSETTING IN R PROGRAMMING!

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Daily News

GitHub’s new feature “passwordless authentication” aims to increase account security and provide a smoother user experience. By opting for the “Enable passkeys” option within...

Artificial Intelligence

Scientists from Japan used AI deep learning to discover new geoglyphs in the Arid Peruvian coastal plain, in the northern part of Peru’s Nazca...

Artificial Intelligence

The Tokyo Institute of Technology and other organizations have announced the start of development of highly performing generative artificial intelligence using the Fugaku supercomputer,...

Artificial Intelligence

Japanese researchers announced that AI ChatGPT technology has succeeded in the annual national doctor’s exam. The AI chatbot, which has advanced speech features that...