What is str function in R?

This recipe explains what is str function in R

Recipe Objective

How to use the str function in R? str displays structures of R objects. str are mostly used for displaying the contents of a list. str () is an alternative function to display the summary of the output produced, especially when the data set is huge. This recipe provides an example on how to use the str function in R.

Build a Multi Touch Attribution Model in Python with Source Code

Step 1 - Create a list

Create a list of required range and store it in a input vector

a <- c(1:8)

Step 2 - Use str() function

Summary of the of the list is obtained after passing through the str()

str(a)

Step 3 - Create a list

b <- c("aaa","bbb","ccc")

Step 4 - Use str() function

Summary of the of the list is obtained after passing through the str()

str(b)

 "Output of the code is :chr "aaa" "bbb" "ccc"  

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

Multilabel Classification Project for Predicting Shipment Modes
Multilabel Classification Project to build a machine learning model that predicts the appropriate mode of transport for each shipment, using a transport dataset with 2000 unique products. The project explores and compares four different approaches to multilabel classification, including naive independent models, classifier chains, natively multilabel models, and multilabel to multiclass approaches.

Deploy Transformer BART Model for Text summarization on GCP
Learn to Deploy a Machine Learning Model for the Abstractive Text Summarization on Google Cloud Platform (GCP)

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

Build CI/CD Pipeline for Machine Learning Projects using Jenkins
In this project, you will learn how to create a CI/CD pipeline for a search engine application using Jenkins.

Learn to Build Generative Models Using PyTorch Autoencoders
In this deep learning project, you will learn how to build a Generative Model using Autoencoders in PyTorch

NLP Project for Multi Class Text Classification using BERT Model
In this NLP Project, you will learn how to build a multi-class text classification model using using the pre-trained BERT model.

Deep Learning Project for Beginners with Source Code Part 1
Learn to implement deep neural networks in Python .

Llama2 Project for MetaData Generation using FAISS and RAGs
In this LLM Llama2 Project, you will automate metadata generation using Llama2, RAGs, and AWS to reduce manual efforts.

MLOps using Azure Devops to Deploy a Classification Model
In this MLOps Azure project, you will learn how to deploy a classification machine learning model to predict the customer's license status on Azure through scalable CI/CD ML pipelines.

Loan Eligibility Prediction using Gradient Boosting Classifier
This data science in python project predicts if a loan should be given to an applicant or not. We predict if the customer is eligible for loan based on several factors like credit score and past history.