What are vectors in R?
MACHINE LEARNING RECIPES DATA CLEANING PYTHON DATA MUNGING PANDAS CHEATSHEET     ALL TAGS

# What are vectors in R?

This recipe explains what are vectors in R

## Recipe Objective

Vectors are nothing but data structures in R used for storing and retrieving various datatypes. Vectors are of two types: 1. Atomic vectors which consists of — Logical, integer, numeric, double and character datatype. Atomic vectors take a single value as an input. 2. Recursive vectors i.e lists, multiple values can be passed using a list.[] are used for indexing list vectors. The class () function is used for finding out the data type of a given vector. This recipe demonstrates different types of vectors that a user can use..

## Step 1 -Atomic Vector type numeric

``` a <- print(123) class(a) ```
```"Output of the code is" :  123
type : numeric ```

## Step 2 - Atomic Vector type integer

``` b <- print(2L) class(b) ```
```"Output of the code is" : 2
type : integer ```

## Step 3 - Atomic Vector type character

``` c <- print("hello there") class(c) ```
```"Output of the code is" : "hello there"
type- character "```

## Step 4 - Vector type -list()

``` x <- c(list("hello",123,2.5,"good")) class(x) ```
```"Output of the code is " :

"hello"
123
2.5
"good"

type - 'list'

```

#### Relevant Projects

##### 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.

##### Churn Prediction in Telecom using Machine Learning in R
Estimating churners before they discontinue using a product or service is extremely important. In this ML project, you will develop a churn prediction model in telecom to predict customers who are most likely subject to churn.

##### Expedia Hotel Recommendations Data Science Project
In this data science project, you will contextualize customer data and predict the likelihood a customer will stay at 100 different hotel groups.

##### Identifying Product Bundles from Sales Data Using R Language
In this data science project in R, we are going to talk about subjective segmentation which is a clustering technique to find out product bundles in sales data.

##### Build a Music Recommendation Algorithm using KKBox's Dataset
Music Recommendation Project using Machine Learning - Use the KKBox dataset to predict the chances of a user listening to a song again after their very first noticeable listening event.

##### PySpark Tutorial - Learn to use Apache Spark with Python
PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.

##### Avocado Machine Learning Project Python for Price Prediction
In this ML Project, you will use the Avocado dataset to build a machine learning model to predict the average price of avocado which is continuous in nature based on region and varieties of avocado.

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

##### 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.

##### Human Activity Recognition Using Multiclass Classification in Python
In this human activity recognition project, we use multiclass classification machine learning techniques to analyse fitness dataset from a smartphone tracker.