Instant R Starter by Unknown

Instant R Starter by Unknown

Author:Unknown
Language: eng
Format: epub
Publisher: Packt Publishing


As you can see, different elements may be combined together in one list object. Each of the listed objects is indicated with a double set of square brackets [[]]. You can use such an index to access an object, or as an alternative, you can rename the elements of the list. In the following example, you will notice how you can access a specific element using its name and the operator $:

> myList <- list(element1, element2, element3) > myList[[3]] [,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 > names(myList) <- c("Vector1","Vector2","Matrix") > myList$Matrix [,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.