Tuesday 8 August 2017

Data Science Tutorial Part 8 List

  1. Lists
  1. A list in R is similar to your to-do list at work or school: the different items on that list most likely differ in length, characteristic, type of activity that has to do be done.
  2. A list in R allows you to gather a variety of objects under one name (that is, the name of the list) in an ordered way. These objects can be matrices, vectors, data frames, even other lists, etc. It is not even required that these objects are related to each other in any way.
  3. You could say that a list is some kind super data type: you can store practically any piece of information in it!
  4. The list of elements can be given names and they can be accessed using these names
    1. Method 1: Named List

    2. Method 2: Named List
  5. Nested List: Create list inside a list
  6. Single bracket [ versus double bracket [[
    1. List is collection of vectors
    2. In above list we have 4 vectors
    3. First vector is
    4. Get first vector of list
    5. Get first element of first vector
    6. Get second element of first vector? What you observed?
    7. Get 4 vector 2 element     or
  7. Select elements using names
  8. Selecting elements using logicals (TRUE,FALSE) .Possible only with single brackets
  9. Extending list example 1
  10. Extending list example 2
  11. Add /remove/update list
    Create simple list  
Add element  
Delete element  
update element  
  1. Merge two lists
  2. Convert list to vector
Refer for more info https://cran.r-project.org/doc/manuals/R-intro.html#Lists or http://www.r-tutor.com/r-introduction/list

No comments:

Post a Comment