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
588 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
• 33,030 points
2,088 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 29, 2019 in Data Analytics by anonymous
• 33,030 points
6,612 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 29, 2019 in Data Analytics by Cherukuri
• 33,030 points
48,186 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
2,260 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
1,948 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, 2020 by Gitika 1,195 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
1,373 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 28, 2018 in Data Analytics by Sophie may
• 10,620 points
1,361 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP