How to subtract 2 numbers in R?

How to subtract 2 numbers in R?

How to subtract 2 numbers in R?

This recipe helps you subtract 2 numbers in R


Recipe Objective

This recipe demonstrates how to carry out one of the basic arithmetic operation i.e. Subtraction. We will perform subtraction on two numbers and store them in the 'result' variable.

Step 1: Creating two numeric variables

We assign numbers to two variables.

a <- 10 b <- 5

Step 2: Subtracting the two variables

We use the arithmetic operator " - " to carry out this task and finally store the result in a third variable.

result <- a - b # displaying the value stored in result result

Alternatively, we can also subtract two numbers without assigning any variables to it. Just like a calculator. This is done simply by writing the operation below and pressing 'enter'


Relevant Projects

Natural language processing Chatbot application using NLTK for text classification
In this NLP AI application, we build the core conversational engine for a chatbot. We use the popular NLTK text classification library to achieve this.

Choosing the right Time Series Forecasting Methods
There are different time series forecasting methods to forecast stock price, demand etc. In this machine learning project, you will learn to determine which forecasting method to be used when and how to apply with time series forecasting example.

Machine Learning Project to Forecast Rossmann Store Sales
In this machine learning project you will work on creating a robust prediction model of Rossmann's daily sales using store, promotion, and competitor data.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

Resume parsing with Machine learning - NLP with Python OCR and Spacy
In this machine learning resume parser example we use the popular Spacy NLP python library for OCR and text classification.

Predict Macro Economic Trends using Kaggle Financial Dataset
In this machine learning project, you will uncover the predictive value in an uncertain world by using various artificial intelligence, machine learning, advanced regression and feature transformation techniques.

Data Science Project in Python on BigMart Sales Prediction
The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

Machine Learning project for Retail Price Optimization
In this machine learning pricing project, we implement a retail price optimization algorithm using regression trees. This is one of the first steps to building a dynamic pricing model.

Mercari Price Suggestion Challenge Data Science Project
Data Science Project in Python- Build a machine learning algorithm that automatically suggests the right product prices.

Perform Time series modelling using Facebook Prophet
In this project, we are going to talk about Time Series Forecasting to predict the electricity requirement for a particular house using Prophet.