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

What are vectors in R?

What are vectors in R?

This recipe explains what are vectors in R

0

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

Music Recommendation System Project using Python and R
Machine Learning Project - Work with KKBOX's Music Recommendation System dataset to build the best music recommendation engine.

Data Science Project - Instacart Market Basket Analysis
Data Science Project - Build a recommendation engine which will predict the products to be purchased by an Instacart consumer again.

Deep Learning with Keras in R to Predict Customer Churn
In this deep learning project, we will predict customer churn using Artificial Neural Networks and learn how to model an ANN in R with the keras deep learning package.

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.

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.

Solving Multiple Classification use cases Using H2O
In this project, we are going to talk about H2O and functionality in terms of building Machine Learning models.

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.

Sequence Classification with LSTM RNN in Python with Keras
In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Dataset​ using Keras in Python.

Topic modelling using Kmeans clustering to group customer reviews
In this Kmeans clustering machine learning project, you will perform topic modelling in order to group customer reviews based on recurring patterns.

Customer Market Basket Analysis using Apriori and Fpgrowth algorithms
In this data science project, you will learn how to perform market basket analysis with the application of Apriori and FP growth algorithms based on the concept of association rule learning.