What does identifical function do in R

This recipe explains what does identifical function do in R

Recipe Objective

What does identical function do?

An identical function is used in R to check whether two R objects are equal/ identical or not. Syntax: **identical (x,y)** where, x,y are 2 input values that can be vectors, matrix, etc. The output of this function is either TRUE if the values are identical in nature or FALSE if they are not identical in nature. This recipe demonstrates examples of identical functions in R.

Learn to Build a Multi Class Image Classification Model in Python from Scratch

Step 1 - Check identical()

identical(1,1)

"Output of code :"
TRUE

identical(0.88,1)

"Output of code :"
FALSE

identical(0, 0 / 3)

"Output of code :"
TRUE

identical(4, 16/4)

"Output of code :"
TRUE

identical(6,"6")

"Output of code :"
FALSE

identical(T,TRUE)

"Output of code :"
TRUE

Step 2 - Use identical() on matrix

mat_1 <- matrix(c(1:12),nrow=4,ncol=4,byrow=TRUE) print(mat_1) mat_2 <- matrix(c(1:12),nrow=4,ncol=4,byrow=FALSE) print(mat_2) identical(mat_1,mat_2)

"Output of code :"
FALSE

{"mode":"full","isActive":false}

What Users are saying..

profile image

Abhinav Agarwal

Graduate Student at Northwestern University
linkedin profile url

I come from Northwestern University, which is ranked 9th in the US. Although the high-quality academics at school taught me all the basics I needed, obtaining practical experience was a challenge.... Read More

Relevant Projects

Build a Face Recognition System in Python using FaceNet
In this deep learning project, you will build your own face recognition system in Python using OpenCV and FaceNet by extracting features from an image of a person's face.

Build an AI Chatbot from Scratch using Keras Sequential Model
In this NLP Project, you will learn how to build an AI Chatbot from Scratch using Keras Sequential Model.

GCP MLOps Project to Deploy ARIMA Model using uWSGI Flask
Build an end-to-end MLOps Pipeline to deploy a Time Series ARIMA Model on GCP using uWSGI and Flask

Create Your First Chatbot with RASA NLU Model and Python
Learn the basic aspects of chatbot development and open source conversational AI RASA to create a simple AI powered chatbot on your own.

Personalized Medicine: Redefining Cancer Treatment
In this Personalized Medicine Machine Learning Project you will learn to classify genetic mutations on the basis of medical literature into 9 classes.

PyTorch Project to Build a GAN Model on MNIST Dataset
In this deep learning project, you will learn how to build a GAN Model on MNIST Dataset for generating new images of handwritten digits.

Hands-On Approach to Regression Discontinuity Design Python
In this machine learning project, you will learn to implement Regression Discontinuity Design Example in Python to determine the effect of age on Mortality Rate in Python.

Build ARCH and GARCH Models in Time Series using Python
In this Project we will build an ARCH and a GARCH model using Python

House Price Prediction Project using Machine Learning in Python
Use the Zillow Zestimate Dataset to build a machine learning model for house price prediction.

Classification Projects on Machine Learning for Beginners - 1
Classification ML Project for Beginners - A Hands-On Approach to Implementing Different Types of Classification Algorithms in Machine Learning for Predictive Modelling