What is the difference between the list and vector in R?
Oct 16, 2019 45,438 views

## 1 answer to this question.

The difference are -

• A list holds different data such as Numeric, Character, logical, etc. Vector stores elements of the same type or converts implicitly.
• Lists are recursive, whereas vector is not.
• The vector is one-dimensional, whereas the list is a multidimensional object.
• 33,030 points
What do you mean by recursive? Kindly explain it in detail.

Hi,

• In a recursive function (recursion), function calls itself. To solve any we break the programs into smaller sub-programs.

eg:

5! = 5*4*3*2*1 = 120

• The problem of getting a factorial of 5 is broken down into a sub-problem of multiplying the factorial of 4and 3.
• Recursive functions call themselves. They break down the problem into the smallest possible components. The function() calls itself within the original function() on each of the smaller components.
• Due to this capability of containing other lists within themselves (lists), lists are considered as the recursive variables.

I hope this information will help you to understand. If you have a further query you can drop that in our community.

## What is the difference between [] and [[]] notations to access the elements of a list or dataframe in R?

R provides 3 basic indexing operators. Refer ...READ MORE

## What is the difference between library () and require () functions in R ?

library() require() Library () function gives an error message ...READ MORE

## What is the difference between R and SPSS?

One of the main difference is R ...READ MORE

## What is the difference between rm() and rm(list=ls())?

Yes, you can clear all variables in ...READ MORE

## By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

## How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

## In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

## How to create a list of Data frames?

Basically all we have to do is ...READ MORE