Difference between list(1:5) and list(1,2 ...5) in R.

0 votes
What is the difference between list(1:5) and list(1,2 ...5) in R?
Oct 14, 2019 in Data Analytics by anonymous
• 3,450 points
86 views

1 answer to this question.

0 votes

It's very simple. list(1:4) creates a single element(vector) whereas list(1,2,3,4) creates multiple elements(vector)

> l
[[1]]
[1] 1 2 3 4 5

> l1
[[1]]
[1] 1

[[2]]
[1] 2

[[3]]
[1] 3

[[4]]
[1] 4

[[5]]
[1] 5

list(1:4) is a atomic element whreas list(1,2,3,4) is not atomic.

answered Oct 14, 2019 by rajeev

Related Questions In Data Analytics

0 votes
1 answer
0 votes
1 answer

Difference between List(list1,list2) and c(list1,list2) in R

Hi Deepa, It's quite simple, let me explain ...READ MORE

answered Jun 26, 2019 in Data Analytics by Cherukuri
• 32,490 points
460 views
0 votes
1 answer

Difference between [[1]] and [1] in R Programming

Hey Latha, The difference between them is that ...READ MORE

answered Jun 28, 2019 in Data Analytics by anonymous
• 32,490 points
1,469 views
0 votes
1 answer

What is the difference between list and vector in R?

The difference are - A list holds different ...READ MORE

answered Oct 28, 2019 in Data Analytics by Cherukuri
• 32,490 points
9,159 views
0 votes
1 answer

By using dpylr package sum of multiple columns

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

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
836 views
0 votes
1 answer

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

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

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
421 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

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

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9 by Gitika 179 views
0 votes
1 answer

How to create a list of Data frames?

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

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
272 views
0 votes
1 answer

R programming: Finding the difference between 2 vectors

Try this function, it worked for me: f ...READ MORE

answered Dec 27, 2018 in Data Analytics by Sophie may
• 10,100 points
103 views