Explain toupper and tolower and substring function in R?

This recipe explains what toupper and tolower and substring function in R

Recipe Objective

Explain toupper, tolower, substring function in R? - tolower (): converts all the characters of a string into lower case - toupper (): converts all the characters of a string into upper case - substring () : helps extract some specified substring of a character string as well as to replace substring characters in the string. This recipe demonstrates an explanation of different functions in R.

Step 1- Use tolower()

a <- "Hello World" print(tolower(a))
"Output of the code is":"hello world"

Step 2- Use toupper()

b <- "hello world" print(toupper(b))
"Output of the code is":"HELLO WORLD"

Step 3 - Use substring()

c <- "Hello world" # extracts a substring from the main string print(substring(c,2,7))
"Output of the code is":"ello w"
c <- "helloyworld" # replaces y with " " in the string substring(a,6,6)=' ' print(c)
"Output of the code is":'hello world'

What Users are saying..

profile image

Ray han

Tech Leader | Stanford / Yale University
linkedin profile url

I think that they are fantastic. I attended Yale and Stanford and have worked at Honeywell,Oracle, and Arthur Andersen(Accenture) in the US. I have taken Big Data and Hadoop,NoSQL, Spark, Hadoop... Read More

Relevant Projects

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.

CycleGAN Implementation for Image-To-Image Translation
In this GAN Deep Learning Project, you will learn how to build an image to image translation model in PyTorch with Cycle GAN.

Build a Multi Touch Attribution Machine Learning Model in Python
Identifying the ROI on marketing campaigns is an essential KPI for any business. In this ML project, you will learn to build a Multi Touch Attribution Model in Python to identify the ROI of various marketing efforts and their impact on conversions or sales..

Learn to Build an End-to-End Machine Learning Pipeline - Part 1
In this Machine Learning Project, you will learn how to build an end-to-end machine learning pipeline for predicting truck delays, addressing a major challenge in the logistics industry.

Build Customer Propensity to Purchase Model in Python
In this machine learning project, you will learn to build a machine learning model to estimate customer propensity to purchase.

Customer Churn Prediction Analysis using Ensemble Techniques
In this machine learning churn project, we implement a churn prediction model in python using ensemble techniques.

Model Deployment on GCP using Streamlit for Resume Parsing
Perform model deployment on GCP for resume parsing model using Streamlit App.

Build CNN Image Classification Models for Real Time Prediction
Image Classification Project to build a CNN model in Python that can classify images into social security cards, driving licenses, and other key identity information.

Build a Multi Class Image Classification Model Python using CNN
This project explains How to build a Sequential Model that can perform Multi Class Image Classification in Python using CNN

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.